home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Information / Specifications / Audio File Formats / Audio File Formats FAQ
Encoding:
Text File  |  1995-07-12  |  92.9 KB  |  2,271 lines  |  [TEXT/R*ch]

  1. Archive-name: audio-fmts
  2. Submitted-by: Guido van Rossum <guido@cwi.nl>
  3. Version: 3.08
  4. Last-modified: 22-Feb-1994
  5.  
  6. FAQ: Audio File Formats
  7. =======================
  8.  
  9. Table of contents
  10. -----------------
  11.  
  12. Introduction
  13. Device characteristics
  14. Popular sampling rates
  15. Compression schemes
  16. Current hardware
  17. File formats
  18. File conversions
  19. Playing audio files on UNIX
  20. Playing audio files on micros
  21. The Sound Site Newsletter
  22. Posting sounds
  23.  
  24. Appendices:
  25.  
  26. FTP access for non-internet sites
  27. AIFF Format (Audio IFF)
  28. The NeXT/Sun audio file format
  29. IFF/8SVX Format
  30. Playing sound on a PC
  31. The EA-IFF-85 documentation
  32. US Federal Standard 1016 availability
  33. Creative Voice (VOC) file format
  34. RIFF WAVE (.WAV) file format
  35. U-LAW and A-LAW definitions
  36. AVR File Format
  37. The Amiga MOD Format
  38.  
  39.  
  40. Introduction
  41. ------------
  42.  
  43. This is version 3 of this FAQ, which I started in November 1991 under
  44. the name "The audio formats guide".  I bumped the major version number
  45. again at the occasion of the split in two parts: part one is the main
  46. text and part two consists of the collection of appendices.
  47.  
  48. I am posting this about once a fortnight, either unchanged (just to
  49. inform new readers), or updated (if I learn more or when new hardware
  50. or software becomes popular).  I post to alt.binaries.sounds.{misc,d}
  51. and to comp.dsp, for maximal coverage of people interested in audio,
  52. and to {news,comp}.answers, for easy reference.
  53.  
  54. The entire FAQ is also available by anonymous ftp from ftp.cwi.nl
  55. [192.16.184.180], directory pub/audio, files AudioFormats.{part1,part2}.
  56.  
  57. BTW: All FAQs, including this one, are available for anonymous ftp on
  58. the archive site rtfm.mit.edu in directory /pub/usenet/news.answers/.
  59. The name under which a FAQ is archived appears in the "Archive-Name:"
  60. line at the top of the article.  This FAQ is archived as
  61. audio-fmts/part[12].
  62.  
  63. A companion posting with subject "Changes to: ..." is occasionally
  64. posted listing the diffs between a new version and the last.  This is
  65. not reposted, and it is suppressed when the diffs are bigger than the
  66. new version.
  67.  
  68. Send updates, comments and questions to <guido@cwi.nl>.  I'd like to
  69. thank everyone who sent updates in the past.
  70.  
  71. --Guido van Rossum, CWI, Amsterdam <guido@cwi.nl>
  72.  
  73.  
  74. Device characteristics
  75. ----------------------
  76.  
  77. In this text, I will only use the term "sample" to refer to a single
  78. output value from an A/D converter, i.e., a small integer number
  79. (usually 8 or 16 bits).
  80.  
  81. Audio data is characterized by the following parameters, which
  82. correspond to settings of the A/D converter when the data was
  83. recorded.  Naturally, the same settings must be used to play the data.
  84.  
  85. - sampling rate (in samples per second), e.g. 8000 or 44100
  86.  
  87. - number of bits per sample, e.g. 8 or 16
  88.  
  89. - number of channels (1 for mono, 2 for stereo, etc.)
  90.  
  91. Approximate sampling rates are often quoted in Hz or kHz ([kilo-]
  92. Hertz), however, the politically correct term is samples per second
  93. (samples/sec).  Sampling rates are always measured per channel, so for
  94. stereo data recorded at 8000 samples/sec, there are actually 16000
  95. samples in a second.  I will sometimes write 8 k as a shorthand for
  96. 8000 samples/sec.
  97.  
  98. Multi-channel samples are generally interleaved on a frame-by-frame
  99. basis: if there are N channels, the data is a sequence of frames,
  100. where each frame contains N samples, one from each channel.  (Thus,
  101. the sampling rate is really the number of *frames* per second.)  For
  102. stereo, the left channel usually comes first.
  103.  
  104. The specification of the number of bits for U-LAW (pronounced mu-law
  105. -- the u really stands for the Greek letter mu) samples is somewhat
  106. problematic.  These samples are logarithmically encoded in 8 bits,
  107. like a tiny floating point number; however, their dynamic range is
  108. that of 12 bit linear data.  Source for converting to/from U-LAW
  109. (written by Jef Poskanzer) is distributed as part of the SOX package
  110. mentioned below; it can easily be ripped apart to serve in other
  111. applications.  The official definition is the CCITT standard G.711.
  112.  
  113. There exists another encoding similar to U-LAW, called A-LAW, which
  114. is used as a European telephony standard.  There is less support for
  115. it in UNIX workstations.
  116.  
  117. (See the Appendix for some formulae describing U-LAW and A-LAW.)
  118.  
  119.  
  120. Popular sampling rates
  121. ----------------------
  122.  
  123. Some sampling rates are more popular than others, for various reasons.
  124. Some recording hardware is restricted to (approximations of) some of
  125. these rates, some playback hardware has direct support for some.  The
  126. popularity of divisors of common rates can be explained by the
  127. simplicity of clock frequency dividing circuits :-).
  128.  
  129. Samples/sec     Description
  130.  
  131. 5500            One fourth of the Mac sampling rate (rarely seen).
  132.  
  133. 7333            One third of the Mac sampling rate (rarely seen).
  134.  
  135. 8000            Exactly 8000 samples/sec is a telephony standard that
  136.                 goes together with U-LAW (and also A-LAW) encoding.
  137.                 Some systems use an slightly different rate; in
  138.                 particular, the NeXT workstation uses 8012.8210513,
  139.                 apparently the rate used by Telco CODECs.
  140.  
  141. 11 k            Either 11025, a quarter of the CD sampling rate,
  142.                 or half the Mac sampling rate (perhaps the most
  143.                 popular rate on the Mac).
  144.  
  145. 16000           Used by, e.g. the G.722 compression standard.
  146.  
  147. 18.9 k          CD-ROM/XA standard.
  148.  
  149. 22 k            Either 22050, half the CD sampling rate, or the Mac
  150.                 rate; the latter is precisely 22254.545454545454 but
  151.                 usually misquoted as 22000.  (Historical note:
  152.                 22254.5454... was the horizontal scan rate of the
  153.                 original 128k Mac.)
  154.  
  155. 32000           Used in digital radio, NICAM (Nearly-Instantaneous
  156.                 Companded Audio Multiplex [IBA/BREMA/BBC]) and other
  157.                 TV work, at least in the UK; also long play DAT and
  158.                 Japanese HDTV.
  159.  
  160. 37.8 k          CD-ROM/XA standard for higher quality.
  161.  
  162. 44056           This weird rate is used by professional audio
  163.                 equipment to fit an integral number of samples in a
  164.                 video frame.
  165.  
  166. 44100           The CD sampling rate.  (DAT players recording
  167.                 digitally from CD also use this rate.)
  168.  
  169. 48000           The DAT (Digital Audio Tape) sampling rate for
  170.                 domestic use.
  171.  
  172. Files samples on SoundBlaster hardware have sampling rates that are
  173. divisors of 1000000.
  174.  
  175. While professinal musicians disagree, most people don't have a problem
  176. if recorded sound is played at a slightly different rate, say, 1-2%.
  177. On the other hand, if recorded data is being fed into a playback
  178. device in real time (say, over a network), even the smallest
  179. difference in sampling rate can frustrate the buffering scheme used...
  180.  
  181. There may be an emerging tendency to standardize on only a few
  182. sampling rates and encoding styles, even if the file formats may
  183. differ.  The suggested rates and styles are:
  184.  
  185.     rate (samp/sec) style mono/stereo
  186.  
  187.     8000 8-bit U-LAW mono
  188.     22050 8-bit linear unsigned mono and stereo
  189.     44100 16-bit linear signed mono and stereo
  190.  
  191.  
  192. Compression schemes
  193. -------------------
  194.  
  195. Strange though it seems, audio data is remarkably hard to compress
  196. effectively.  For 8-bit data, a Huffman encoding of the deltas between
  197. successive samples is relatively successful.  For 16-bit data,
  198. companies like Sony and Philips have spent millions to develop
  199. proprietary schemes.  Information about PASC (Philips' scheme) can be
  200. found in Advanced Digital Audio by Ken C. Pohlmann.
  201.  
  202. Public standards for voice compression are slowly gaining popularity,
  203. e.g. CCITT G.721 (ADPCM at 32 kbits/sec) and G.723 (ADPCM at 24 and 40
  204. kbits/sec).  (ADPCM == Adaptive Delta Pulse Code Modulation.)  Sun
  205. Microsoft has placed the source code of a portable implementation of
  206. these algorithms (as well as G.711, which defines A-LAW and U-LAW) in
  207. the public domain (needless to say, their proprietary implementation
  208. distributed in binary form with Solaris is better :-).  One place to
  209. ftp this source code from is ftp.cwi.nl:/pub/audio/ccitt-adpcm.tar.Z.
  210. Source for another 32 kbits/sec ADPCM implementation, assumed to be
  211. compatible with Intel's DVI audio format, can be ftp'ed from
  212. ftp.cwi.nl:/pub/audio/adpcm.shar.  (** NOTE: if you are using v1.0,
  213. you should get v1.1, released 17-Dec-1992, which fixes a serious bug
  214. -- the quality of v1.1 is claimed to be better than U-LAW **)
  215.  
  216. GSM 06.10 is a speech encoding in use in Europe that compresses 160
  217. 13-bit samples into 260 bits (or 33 bytes), i.e. 1650 bytes/sec (at
  218. 8000 samples/sec).  A free implementation can be ftp'ed from
  219. tub.cs.tu-berlin.de, file /pub/tubmik/gsm-1.0.tar.Z.
  220.  
  221. There are also two US federal standards, 1016 (Code excited linear
  222. prediction (CELP), 4800 bits/s) and 1015 (LPC-10E, 2400 bits/s).  See
  223. also the appendix for 1016.
  224.  
  225. Tony Robinson <ajr@eng.cam.ac.uk> has written a good FAST loss-less
  226. compression for lots of different audio formats (particularly good for
  227. WAV and MOD files).  The software is available by anonymous ftp from
  228. svr-ftp.eng.cam.ac.uk [129.169.24.20], directory misc, file
  229. shorten-1.08.tar.Z.
  230.  
  231. (Note that U-LAW and silence detection can also be considered
  232. compression schemes.)
  233.  
  234. Here's a note about audio codings by Van Jacobson <van@ee.lbl.gov>:
  235. Several people used the words "LPC" and "CELP" interchangably.  They
  236. are very different.  An LPC (Linear Predictive Coding) coder fits
  237. speech to a simple, analytic model of the vocal tract, then throws
  238. away the speech & ships the parameters of the best-fit model.  An LPC
  239. decoder uses those parameters to generate synthetic speech that is
  240. usually more-or-less similar to the original.  The result is
  241. intelligible but sounds like a machine is talking.  A CELP (Code
  242. Excited Linear Predictor) coder does the same LPC modeling but then
  243. computes the errors between the original speech & the synthetic model
  244. and transmits both model parameters and a very compressed
  245. representation of the errors (the compressed representation is an
  246. index into a 'code book' shared between coders & decoders -- this is
  247. why it's called "Code Excited").  A CELP coder does much more work
  248. than an LPC coder (usually about an order of magnitude more) but the
  249. result is much higher quality speech: The FIPS-1016 CELP we're working
  250. on is essentially the same quality as the 32Kb/s ADPCM coder but uses
  251. only 4.8Kb/s (the same as the LPC coder).
  252.  
  253. The comp.compression FAQ has some text on the 6:1 audio compression
  254. scheme used by MPEG (a video compression standard-to-be).  It's
  255. interesting to note that video compression reaches much higher ratios
  256. (like 26:1).  This FAQ is ftp'able from rtfm.mit.edu [18.72.1.58] in
  257. directory /pub/usenet/news.answers/compression-faq, files part1 and
  258. part2.
  259.  
  260. Comp.compression also carries a regular posting "How to uncompress
  261. anything" by David Lemson <lemson@uiuc.edu>, which (tersely) hints on
  262. which program you need to uncompress a file whose name ends in .<foo>
  263. for almost any conceivable <foo>.  Ftp'able from ftp.cso.uiuc.edu
  264. (128.174.5.59) in the directory /doc/pcnet as the file compression.
  265.  
  266. Documentation on a digital cellular telephone system by Qualcomm Inc.
  267. can be ftp'ed from ftp.qualcomm.com:/pub/cdma; the vocoder is in
  268. appendix A.
  269.  
  270. Apple has an Audio Compression/Expansion scheme called ACE (on the GS)
  271. / MACE (on the Macintosh).  It's a lossy scheme that attempts to
  272. predict where the wave will go on the next sample. There's very little
  273. quality change on 8:4 compression, somewhat more for 8:3.  It does
  274. guarantee exactly 50% or 62.5% compression, though.  I believe MACE
  275. uses larger ratios/more loss, but I'm unsure of the specific numbers.
  276. (Marc Sira)
  277.  
  278.  
  279. Current hardware
  280. ----------------
  281.  
  282. I am aware of the following computer systems that can play back and
  283. (sometimes) record audio data, with their characteristics.  Note that
  284. for most systems you can also buy "professional" sampling hardware,
  285. which supports much better quality, e.g. >= 44.1 k 16 bits stereo.
  286. The characteristics listed here are a rough estimate of the
  287. capabilities of the basic hardware only (and even here I am on thin
  288. ice, with systems becoming ever more powerful).
  289.  
  290. machine             bits            max sampling rate    #output channels
  291.  
  292. Mac (all types)     8               22k                  1
  293. Mac (newer ones)    16              64k                  4(128)
  294. Apple IIgs          8               32k / >70k           16(st)
  295. PC/soundblaster pro 8               ?/(22k st, 44.1k mo) 1(st)
  296. PC/soundblaster 16  16              44.1k                1(st)
  297. PC/pas              8               44.1k st, 88.2k mo   1(st)
  298. PC/pas-16           16              44.1k st, 88.2k mo   1(st)
  299. PC/turtle beach multisound 16       44.1k                1(st)
  300. PC/cards with aria chipset 16       44.1k                1(st)
  301. PC/roland rap-10    16              44.1k                1(st)
  302. PC/gravis ultrasound 8/16           44.1k                14-32(st)
  303. Atari ST            8               22k                  1
  304. Atari STE,TT        8               50k                  2
  305. Atari Falcon 030    16              50k                  8(st)
  306. Amiga               8               varies above 29k     4(st)
  307. Sun Sparc           U-LAW           8k                   1
  308. Sun Sparcst. 10     U-LAW,8,16      48k                  1(st)
  309. NeXT                U-LAW,8,16      44.1k                1(st)
  310. SGI Indigo          8,16            48k                  4(st)
  311. SGI Indigo2,Indy    8,16            48k                  16(st,4-channel)
  312. Acorn Archimedes    ~U-LAW          ~180k                8(st)
  313. Sony NWS-3xxx       U,A,8,16        8-37.8k              1(st)
  314. Sony NWS-5xxx       U,A,8,16        8-48k                1(st)
  315. VAXstation 4000     U-LAW           8k                   1
  316. DEC 3000/300-500    U-LAW           8k                   1
  317. DEC 5000/20-25      U-LAW           8k                   1
  318. Tandy 1000/*L*      8               22k                  3
  319. Tandy 2500          8               22k                  3
  320. HP9000/705,710,425e U,A-LAW,16      8k                   1
  321. HP9000/715,725,735  U,A-LAW,16      48k                  1(st)
  322. HP9000/755 option:  U,A-LAW,16      48k                  1(st)
  323. NCD MCX terminal    U,A,8,16        52k                  1(st)
  324.  
  325. 4(st) means "four voices, stereo"; sampling rates xx/yy are
  326. different recording/playback rates; *L* is any type with 'L' in it.
  327.  
  328. All these machines can play back sound without additional hardware,
  329. although the needed software is not always standard; also, some
  330. machines need external hardware to record sound (or to record at
  331. higher quality, like the NeXT, whose built-in sampling hardware only
  332. does 8000 samples/sec in U-LAW).  Please don't send me details on
  333. optional or 3rd party hardware, there is too much and it is really
  334. beyond the scope of this FAQ.  In particular, there is a separate
  335. newsgroup devoted to PC sound cards: comp.sys.ibm.pc.soundcard, which
  336. includes FAQ of its own (also posted to comp.answers and news.answers).
  337.  
  338. The new VAXstation 4000 (VLC and model 60) series lets you PLAY audio
  339. (.au) files, and the package DECsound will let you do the recording.
  340. In fact, DECsound is given away free with Motif 1.1 and supports the
  341. VAXstation, Sun SPARCstation, DECvoice, and DECaudio devices.  Sun
  342. sound files work without change.  The Alpha systems (DEC 3000 Model
  343. 300, 400, 500) also have DECsound bundled with Motif.
  344.  
  345. Notes for the DECstation 5000/20-25: You need either XMedia tools from
  346. DEC ($$$$), or the AudioFile package (which works nicely) from
  347. crl.dec.com (see below). The audio device is "/dev/bba", you cannot
  348. send ".au" files directly to the device, the Xmedia/AF software
  349. provide an "audioserver" which must be run to play/record sounds.
  350.  
  351. The SGI Personal IRIS 4D/30 and 4D/35 have the same capabilities as
  352. the Indigo. The audio board was optional on the 4D/30.
  353. The Indigo2 and Indy features are a superset of the Indigo features.
  354.  
  355. The new Apple Macs have more powerful audio hardware; the latest
  356. models have built-in microphones.
  357.  
  358. Software exists for the PC that can play sound on its 1-bit speaker
  359. using pulse width modulation (see appendix); the Soundblaster board
  360. records at rates up to 13 k and plays back up to 22 k (weird
  361. combination, but that's the way it is).
  362.  
  363. Here's some info about the newest Atari machine, the Falcon030.  This
  364. machine has stereo 16 bit CODECs and a 32 MHz Motorola 56001 that can
  365. handle 8 channels of 16 bit audio, up to 50 khz/channel with
  366. simultaneous playback and record.  The Falcon DMA sound engine is also
  367. compatible with the 8 bit stereo DMA used on the STe and TT. All of
  368. these systems use signed data.
  369.  
  370. On the NeXT, the Motorola 56001 DSP chip is programmable and you can
  371. (in principle) do what you want.  The SGI Indigo uses the same DSP chip but
  372. it can't be programmed by users -- SGI prefers to offer it as a shared
  373. system resource to multiple applications, thus enabling developers to
  374. program audio with their Audio Library and avoid code modifications
  375. for execution on future machines with different audio hardware, i.e. a
  376. different DSP. For example, the Indigo2 and Indy do not have a DSP chip.
  377.  
  378. The Amiga also has a 6-bit volume, which can be used to produce
  379. something like a 14-bit output for each voice.  The hardware can also
  380. use one of each voice-pair to modulate the other in FM (period) or AM
  381. (volume, 6-bits).
  382.  
  383. The Acorn Archimedes uses a variation on U-LAW with the bit order
  384. reversed and the sign bit in bit 0.  Being a 'minority' architecture,
  385. Arc owners are quite adept at converting sound/image formats from
  386. other machines, and it is unlikely that you'll ever encounter sound in
  387. one of the Arc's own formats (there are several).
  388.  
  389. The NCD MCX terminal has audio integrated with its X server.  The
  390. NCDAudio server is an extension of the X server, working together with
  391. it, with stress on the networking capability of sound transmission.
  392. The NCDAudio API provides format handling (ULAW8, Linear Unsig 8,
  393. Linear Sig 8, Linear Sig 16 MSB, Linear Unsig 16 MSB), flowing (to the
  394. server, from the server, to the i/o, from the i/o), wave form
  395. generators (Square, Sine, Saw, Constant) and the capability of area
  396. broadcast using UDP.  Provision for manipulating data files
  397. (SND, WAV, VOC & AU) is also provided.
  398.  
  399. CD-I machines form a special category.  The following formats are used:
  400.  
  401.      - PCM 44.1 kHz standard CD format
  402.      - ADPCM - Addaptive Delta PCM
  403.        - Level A 37.8 kHz 8-bit
  404.        - Level B 37.8 kHz 4-bit
  405.        - Level C 18.9 kHz 4-bit
  406.  
  407.  
  408. File formats
  409. ------------
  410.  
  411. Historically, almost every type of machine used its own file format
  412. for audio data, but some file formats are more generally applicable,
  413. and in general it is possible to define conversions between almost any
  414. pair of file formats -- sometimes losing information, however.
  415.  
  416. File formats are a separate issue from device characteristics.  There
  417. are two types of file formats: self-describing formats, where the
  418. device parameters and encoding are made explicit in some form of
  419. header, and "raw" formats, where the device parameters and encoding
  420. are fixed.
  421.  
  422. Self-describing file formats generally define a family of data
  423. encodings, where a header fields indicates the particular encoding
  424. variant used.  Headerless formats define a single encoding and usually
  425. allows no variation in device parameters (except sometimes sampling
  426. rate, which can be a pain to figure out other than by listening to the
  427. sample).
  428.  
  429. The header of self-describing formats contains the parameters of the
  430. sampling device and sometimes other information (e.g. a
  431. human-readable description of the sound, or a copyright notice).  Most
  432. headers begin with a simple "magic word".  (Some formats do not simply
  433. define a header format, but may contain chunks of data intermingled
  434. with chunks of encoding info.)  The data encoding defines how the
  435. actual samples are stored in the file, e.g. signed or unsigned, as
  436. bytes or short integers, in little-endian or big-endian byte order,
  437. etc.  Strictly spoken, channel interleaving is also part of the
  438. encoding, although so far I have seen little variation in this area.
  439.  
  440. Some file formats apply some kind of compression to the data, e.g.
  441. Huffman encoding, or simple silence deletion.
  442.  
  443. Here's an overview of popular file formats.
  444.  
  445.         Self-describing file formats
  446.         ----------------------------
  447.  
  448. extension, name   origin          variable parameters (fixed; comments)
  449.  
  450. .au or .snd       NeXT, Sun       rate, #channels, encoding, info string
  451. .aif(f), AIFF     Apple, SGI      rate, #channels, sample width, lots of info
  452. .aif(f), AIFC     Apple, SGI      same (extension of AIFF with compression)
  453. .iff, IFF/8SVX    Amiga           rate, #channels, instrument info (8 bits)
  454. .voc              Soundblaster    rate (8 bits/1 ch; can use silence deletion)
  455. .wav, WAVE        Microsoft       rate, #channels, sample width, lots of info
  456. .sf               IRCAM           rate, #channels, encoding, info
  457. none, HCOM        Mac             rate (8 bits/1 ch; uses Huffman compression)
  458. none, MIME        Internet        (see below)
  459. none, NIST SPHERE DARPA speech community (see below)
  460. .mod or .nst      Amiga           (see below)
  461.  
  462. Note that the filename extension ".snd" is ambiguous: it can be either
  463. the self-describing NeXT format or the headerless Mac/PC format, or
  464. even a headerless Amiga format.
  465.  
  466. I know nothing for sure about the origin of HCOM files, only that
  467. there are a lot of them floating around on our system and probably at
  468. FTP sites over the world.  The filenames usually don't have a ".hcom"
  469. extension, but this is what SOX (see below) uses.  The file format
  470. recognized by SOX includes a MacBinary header, where the file
  471. type field is "FSSD".  The data fork begins with the magic word "HCOM"
  472. and contains Huffman compressed data; after decompression it it is 8
  473. bits unsigned data.
  474.  
  475. IFF/8SVX allows for amplitude contours for sounds (attack/decay/etc).
  476. Compression is optional (and extensible); volume is variable; author,
  477. notes and copyright properties; etc.
  478.  
  479. AIFF, AIFC and WAVE are similar in spirit but allow more freedom in
  480. encoding style (other than 8 bit/sample), amongst others.
  481.  
  482. There are other sound formats in use on Amiga by digitizers and music
  483. programs, such as IFF/SMUS.
  484.  
  485. Appendices describes the NeXT and VOC formats; pointers to more info
  486. about AIFF, AIFC, 8SVX and WAVE (which are too complex to describe
  487. here) are also in appendices.
  488.  
  489. DEC systems (e.g. DECstation 5000) use a variant of the NeXT format
  490. that uses little-endian encoding and has a different magic number
  491. (0x0064732E in little-endian encoding).
  492.  
  493. Standard file formats used in the CD-I world are IFF but on the disc
  494. they're in realtime files.
  495.  
  496. An interesting "interchange format" for audio data is described in the
  497. proposed Internet Standard "MIME", which describes a family of
  498. transport encodings and structuring devices for electronic mail.  This
  499. is an extensible format, and initially standardizes a type of audio
  500. data dubbed "audio/basic", which is 8-bit U-LAW data sampled at 8000
  501. samples/sec.
  502.  
  503. The "IRCAM" sound file system has now been superseded by the so-called
  504. "BICSF" (for Berkeley/IRCAM/CARL Sound File system) software release.
  505. More recently, there has been an effort at Princeton (Prof. Paul
  506. Lansky) and Stanford (Stephen Travis Pope) to standardize several
  507. extensions to BICSF.  A description of BICSF and the
  508. Princeton/Stanford extensions is available by anonymous ftp from
  509. ftp.cwi.nl [192.16.184.180], in directory /pub/audio/BICSF-info.  This
  510. file contains further ftp pointers to software.
  511.  
  512. A sound file format popular in the DARPA speech community is the NIST
  513. SPHERE standard.  The most recent version of the SPHERE package is
  514. available via anonymous ftp from jaguar.ncsl.nist.gov [129.6.48.157]
  515. in compressed tar form as "sphere-v.tar.Z" (where "v" is the version
  516. code).  The NIST SPHERE header is an object-oriented, 1024-byte
  517. blocked, ASCII structure which is prepended to the waveform data.  The
  518. header is composed of a fixed-format portion followed by an
  519. object-oriented variable portion.  I have placed a short description
  520. of NIST SPHERE on ftp.cwi.nl:/pub/audio/NIST-SPHERE.
  521.  
  522. Finally, a somewhat different but popular format are "MOD" files,
  523. usually with extension ".mod" or ".nst" (they can also have a prefix
  524. of "mod.").  This originated at the Amiga but players now exist for
  525. many platforms.  MOD files are music files containing 2 parts: (1) a
  526. bank of digitized samples; (2) sequencing information describing how
  527. and when to play the samples.  See the appendix "The Amiga MOD Format"
  528. for a description of this file format (and pointers to ftp'able
  529. players and example MOD files).
  530.  
  531.         Headerless file formats
  532.         -----------------------
  533.  
  534. extension       origin          parameters
  535. or name
  536.  
  537. .snd, .fssd     Mac, PC         variable rate, 1 channel, 8 bits unsigned
  538. .ul             US telephony    8 k, 1 channel, 8 bit "U-LAW" encoding
  539. .snd?           Amiga           variable rate, 1 channel, 8 bits signed
  540.  
  541. It is usually easy to distinguish 8-bit signed formats from unsigned
  542. by looking at the beginning of the data with 'od -b <file | head';
  543. since most sounds start with a little bit of silence containing small
  544. amounts of background noise, the signed formats will have an abundance
  545. of bytes with values 0376, 0377, 0, 1, 2, while the unsigned formats
  546. will have 0176, 0177, 0200, 0201, 0202 instead.  (Using "od -c" will
  547. also show any headers that are tacked in front of the file.)
  548.  
  549. The Apple IIgs records raw data in the same format as the Mac, but
  550. uses a 0 byte as a terminator; samples with value 0 are replaced by 1.
  551.  
  552.         Sound formats and the Apple Macintosh
  553.         -------------------------------------
  554.  
  555. (Thanks to Bill Houle, <Bill.Houle@SanDiegoCA.NCR.COM>)
  556.  
  557.                              SOX/DOS   MAC
  558. Sound Format           file ext  type  Mac program to convert to 'snd'
  559. ---------------------- --------  ----  -------------------------------
  560. Mac snd                .snd      sfil  [n/a]
  561. Amiga IFF/8SVX         .iff            AmigaSndConverter, BST
  562. Amiga SoundTracker     .mod      STrk  ModVoicer
  563. Audio IFF              .aiff     AIFF  SoundExtractor, Sample Editor,
  564.                                        UUTool, BST, M5Mac
  565. DSP Designer                     DSPs  SoundHack
  566. IRCAM                  .sf       IRCM  SoundHack
  567. MacMix                           MSND  SoundHack
  568. RIFF WAVE              .wav            SoundExtractor, BST, Balthazar
  569. SoundBlaster           .voc            SoundExtractor, BST
  570. SoundDesigner/AudioMedia         Sd2f  SoundHack
  571. Sound[Edit|Cap|Wave]   .hcom     FSSD  SoundExtractor, SoundEdit,
  572.                                        Wavicle, BST
  573. Sun uLaw/Next .snd     .au/.snd  NxTS  SoundExtractor, SoundHack,
  574.                                        au<->snd, UUTool, BST
  575.  
  576.  
  577. File conversions
  578. ----------------
  579.  
  580.         SOX (UNIX, PC, Amiga)
  581.         ---------------------
  582.  
  583. The most versatile tool for converting between various audio formats
  584. is SOX ("Sound Exchange").  It can read and write various types of
  585. audio files, and optionally applies some special effects (e.g. echo,
  586. channel averaging, or rate conversion).
  587.  
  588. SOX recognizes all filename extensions listed above except ".snd",
  589. which would be ambiguous anyway, and ".wav" (but there's a patch, see
  590. below).  Use type ".au" for NeXT ".snd" files.  Mac and PC ".snd"
  591. files are completely described by these parameters:
  592.  
  593.         -t raw -b -u -r 11000
  594.  
  595. (or -r 22000 or -r 7333 or -r 5500; 11000 seems to be the most common
  596. rate).
  597.  
  598. The source for SOX, version 6, platchlevel 8, was posted to
  599. alt.sources, and should be widely archived.  (Patch 9 was posted later
  600. and incporporates some important .wav fixes.)  To save you the trouble
  601. of hunting it down, it can be gotten by anonymous ftp from
  602. wuarchive.wustl.edu, in the directory usenet/alt.sources/articles,
  603. files 7288.Z through 7295.Z.  (These files are compressed news
  604. articles containing shar files, if you hadn't guessed.)  I am sure
  605. many sites have similar archives, I'm just listing one that I know of
  606. and which carries a lot of this kind of stuff.  (Also see the appendix
  607. if you don't have Internet access.)
  608.  
  609. A compressed tar file containing the same version of SOX is available
  610. by anonymous ftp from ftp.cwi.nl [192.16.184.180], in directory
  611. /pub/audio/sox7.tar.Z.  You may be able to locate a nearer version
  612. using archie!
  613.  
  614. Ports of SOX:
  615.  
  616. - The source as posted should compile on any UNIX and PC system.
  617.  
  618. - A PC version is available by ftp from ftp.cwi.nl (see above) as
  619.   pub/audio/sox5dos.zip; also available from the garbo mail server.
  620.  
  621. - The latest Amiga SOX is available via anonymous ftp to
  622.   wuarchive.wustl.edu, files systems/amiga/audio/utils/amisox*.  (See
  623.   below for a non-SOX solution.)
  624.   The final release of r6 will compile as distributed on the Amiga with
  625.   SAS/C version 6.  Binaries (since many Amiga users do not own
  626.   compilers) will continue to be available for FTP.
  627.  
  628. SOX usage hints:
  629.  
  630. - Often, the filename extension of sound files posted on the net is
  631.   wrong.  Don't give up, try a few other possibilities using the
  632.   "-t <type>" option.  Remember that the most common file type is
  633.   unsigned bytes, which can be indicated with "-t ub".  You'll have to
  634.   guess the proper sampling rate, but often it's 11k or 22k.
  635.  
  636. - In particular, with SOX version 4 (or earlier), you have to
  637.   specify "-t 8svx" for files with an .iff extension.
  638.  
  639. - When converting linear samples to U-LAW using the .au type for the
  640.   output file, you must specify "-U" for the output file, otherwise
  641.   you will end up with a file containing a NeXT/Sun header but linear
  642.   samples -- only the NeXT will play such files correctly.  Also, you
  643.   must explicitly specify an output sampling rate with "-r 8000".
  644.   (This may seem fixed for most cases in version 5, but it is still
  645.   occasionally necessary, so I'm keeping this warning in.)
  646.  
  647.         Sun Sparc
  648.         ---------
  649.  
  650. On Sun Sparcs, starting at SunOS 4.1, a program "raw2audio" is
  651. provided by Sun (in /usr/demo/SOUND -- see below) which takes a raw
  652. U-LAW file and turns it into a ".au" file by prefixing it with an
  653. appropriate header.
  654.  
  655.         NeXT
  656.         ----
  657.  
  658. On NeXTs, you can usually rename .au files to .snd and it'll work like
  659. a charm, but some .au files lack header info that the NeXT needs.
  660. This can be fixed by using sndconvert:
  661.  
  662.         sndconvert -c 1 -f 1 -s 8012.8210513 -o nextfile.snd sunfile.au
  663.  
  664.         SGI Indigo, Indigo2, Indy and Personal IRIS
  665.         -------------------------------------------
  666.  
  667. SGI supports "soundfiler" (in /usr/sbin), a program similar in
  668. spirit to SOX but with a GUI.  Soundfiler plays aiff, aifc, NeXT/Sun
  669. and .wav formats.  It can do conversions between any of these formats
  670. and to and from raw formats including mulaw.  It also does sample rate
  671. conversions.
  672.  
  673. Three shell commands are also provided that give the same functionality:
  674. "sfplay", "sfconvert", and "aifcresample" (all in /usr/sbin).
  675.  
  676.         Amiga
  677.         -----
  678.  
  679. Mike Cramer's SoundZAP can do no effects except rate change and it
  680. only does conversions to IFF, but it is generally much faster than
  681. SOX.  (Ftp'able from the same directory as amisox above.)
  682.  
  683. Newer versions of OmniPlay (see below) will also convert to IFF.
  684.  
  685.         Tandy
  686.         -----
  687.  
  688. The Tandy 1000 uses a (proprietary?) compressed format.  There is a PD
  689. Mac to Tandy conversion program called CONVERT.  Leonard Erickson
  690. <leonard@qiclab.scn.rain.com> writes: There is a WAV driver from Tandy
  691. if people ask.  There also appears to be a program that purports to
  692. convert other formats to Tandy, but I haven't tested this one yet.
  693.  
  694.         Apple Macintosh
  695.         ---------------
  696.  
  697. Bill Houle sent the following list:
  698.  
  699. Popular commercial apps are indicated with a [*].  All other programs
  700. mentioned are shareware/freeware available from SUMEX and the various
  701. mirror sites, or check archie for the nearest FTP location.
  702.  
  703. MAC SOUND CONVERSION PROGRAMS
  704.  
  705. SoundHack [Tom Erbe, tom@mills.edu]
  706.   Can read/write Sound Designer II, Audio IFF, IRCAM, DSP Designer and NeXT 
  707.   .snd (or Sun .au); 8-bit uLaw, 8-bit linear, 32-bit floating point and 16-bit
  708.   linear data encoding.  Can read (but not write) raw data files.  Implements
  709.   soundfile convolution, a phase vocoder, a binaural filter and an amplitude 
  710.   analysis & gain change module.
  711.  
  712. SoundExtractor [Alberto Ricci, FRicci@polito.it]
  713.   Extracts 'snd' resources, AIFF, SoundEdit, VOC, and WAV data from
  714.   practically anything, converting to 'snd' files.
  715.  
  716. Balthazar [Craig Marciniak, AOL:TemplarDev]
  717.   Converts WAV files to 'snd'.
  718.   
  719. Brian's Sound Tool [Brian Scott, bscott@ironbark.ucnv.edu.au]
  720.   Converts 'snd' or SoundEdit to WAV.  Can also convert WAV, VOC, AIFF, Amiga
  721.   8SVX and uLaw to 'snd'.
  722.  
  723. AmigaSndConverter [Povl H. Pederson, eco861771@ecostat.aau.dk]
  724.   Converts Amiga IFF/8SVX to Mac 'snd'.
  725.  
  726. au<->Mac [Victor J. Heinz, vic:wbst128@xerox.com]
  727.   Converts Sun uLaw to Mac 'snd'.
  728.   
  729. ULAW [Rod Kennedy, rod@faceng.anu.edu.au]
  730.   Converts 'snd' to Sun uLaw.
  731.  
  732. UUTool [Bernie Wieser, wieser@acs.ucalgary.ca]
  733.   Primarily a uuencode/decode program, but in true Swiss Army Knife
  734.   fashion can also read/write Sun uLaw, AIFF, and 'snd' files.
  735.  
  736. ModVoicer [Kip Walker, Kip_Walker@mcimail.com]
  737.   Converts Amiga MOD voices into SoundEdit files or 'snd' resources.
  738.  
  739. Music 5 Mac [Simone Bettini, space@maya.dei.unipd.it]
  740.   Primarily a Music Synthesis system, but can also convert between 'snd', AIFF,
  741.   and IBM .DAT(?).
  742.  
  743. See also the section on players -- some players also do conversions.
  744.  
  745.  
  746. Playing audio files on UNIX
  747. ---------------------------
  748.  
  749. The commands needed to play an audio file depend on the file format
  750. and the available hardware and software.  Most systems can only
  751. directly play sound in their native format; use a conversion program
  752. (see above) to play other formats.
  753.  
  754.         Sun Sparcstation running SunOS 4.x
  755.         ----------------------------------
  756.  
  757. Raw U-LAW files can be played using "cat file >/dev/audio".
  758.  
  759. A whole package for dealing with ".au" files is provided by Sun on an
  760. experimental basis, in /usr/demo/SOUND.  You may have to compile the
  761. programs first.  (If you can't find this directory, either you are not
  762. running SunOS 4.1 yet, or your system administrator hasn't installed
  763. it -- go ask him for it, not me!)  The program "play" in this
  764. directory recognizes all files in Sun/NeXT format, but a SS 1 or 2 can
  765. play only those using U-LAW encoding at 8 k -- the SS 10 hardware
  766. plays other encodings, too.
  767.  
  768. If you ca't find "play", you can also cat a ".au" file to /dev/audio,
  769. if it uses U-LAW; the header will sound like a short burst of noise
  770. but the rest of the data will sound OK (really, the only difference in
  771. this case between raw U-LAW and ".au" files is the header; the U-LAW
  772. data is exactly the same).
  773.  
  774. Finally, OpenWindows 3.0 has a full-fledged audio tool.  You can drop
  775. audio file icons into it, edit them, etc.
  776.  
  777.         Sun Sparcstation running Solaris 2.0
  778.         ------------------------------------
  779.  
  780. Under SVR4 (and hence Solaris 2.0), writing to /dev/audio from the
  781. shell is a bad idea, because the device driver will flush its queue as
  782. soon as the file is closed.  Use "audioplay" instead.  The supported
  783. formats and sampling rates are the same as above.
  784.  
  785.         NeXT
  786.         ----
  787.  
  788. On NeXT machines, the standard "sndplay" program can play all NeXT
  789. format files (this include Sun ".au" files).  It supports at least
  790. U-LAW at 8 k and 16 bits samples at 22 or 44.1 k.  It attempts
  791. on-the-fly conversions for other formats.
  792.  
  793. Sound files are also played if you double-click on them in the file
  794. browser.
  795.  
  796.         SGI Indigo, Indigo2, Indy and Personal IRIS
  797.         -------------------------------------------
  798.  
  799. On SGI Indigo, Indigo2, Indy and the 4D/30 and /35 Personal IRIS workstations,
  800. "WorkSpace" plays audio files in .aiff, .aifc, .au, and .wav formats if
  801. you double click them and the sampling rate is one of 8000, 11025,
  802. 16000, 22050, 32000, 44100, or 48000.  On the Personal IRIS, you need
  803. to have the audio board installed (check the output from hinv) and you
  804. must run IRIX 3.3.2 or 4.0 or higher.  These files can also be played
  805. with "soundfiler" and "sfplay".  ".aiff" and ".aifc" files at the above
  806. sampling rates can also be played with playaifc.  (All in /usr/sbin)
  807.  
  808. There is no simple /dev/audio interface on these SGI machines.  (There
  809. was one on 4D/25 machines, reading and writing signed linear 8-bit
  810. samples at rates of 8, 16 and 32 k.)
  811.  
  812. A program "playulaw" was posted as part of the "radio 2.0" release
  813. that I posted to several source groups; it plays raw U-LAW files on
  814. the Indigo, Indigo2, Indy or Personal IRIS audio hardware.
  815.  
  816.         Sony NEWS
  817.         ---------
  818.  
  819. The whole current Sony NEWS line (laptop, desktop, server) have
  820. builtin sound capabilities.  You can buy an external board for the
  821. older NEWS machines.  In the default mode (8k/8-bit mulaw), Sun .au
  822. files are directly supported (you can 'cat' .au files to /dev/sb0 and
  823. have them play.)  The /usr/sony/bin/sbplay command on NEWS-OS 6.0
  824. also supports Sun .au files.
  825.  
  826.         Others
  827.         ------
  828.  
  829. Most other UNIX boxes don't have audio hardware and thus can't play
  830. audio data.  This is actually rapidly changing and most new hardware
  831. that hits the market has some form of audio support.  Unfortunately
  832. there is no single portable interface for audio that comes near the
  833. acceptance and functionality (let alone code size :-) of X11 for
  834. graphics.  There are at least two network-transparent packages, both
  835. in some way based on the X11 architecture, that attempt to fillo the
  836. gap:
  837.  
  838. DEC CRL's AudioFile supports Digital RISC systems running Ultrix,
  839. Digital Alpha AXP systems running OSF/1, Sun Sparcs, and SGI
  840. AL-capable systems (e.g., Indigo, Indy).  The source kit is located at
  841. ftp site crl.dec.com [192.58.206.2] in /pub/DEC/AF.
  842.  
  843. NCD's NetAudio supports NCD's MCX line of X terminals as well as
  844. Sparcs running either SunOS 4.1.3 or Solaris 2.2, using the /dev/audio
  845. interface (they claim it should be easy to port).  The source it
  846. located at ftp.x.org [198.112.44.100] in contrib/netaudio.  It is also
  847. ported to SGI (tested on IRIX 5.x), and there are unconfirmed rumors
  848. that it is being ported to SCI and Linux.
  849.  
  850.  
  851. Playing audio files on the Vaxstation 4000 (VMS)
  852. ------------------------------------------------
  853.  
  854. 1) Without DECsound
  855.  
  856. ".au" files can be played by COPYING them to device "SOA0:".  This
  857. device is set up by enabling the driver SODRIVER.  You can use the
  858. following command file:
  859.  
  860. $!---------------- cut here -------------------------------
  861. $! sound_setup.com    enable SOUND driver
  862. $ run sys$system:sysgen
  863. connect soa0 /adapter=0 /csr=%x0e00 /vector=%o304 /driver=sodriver
  864. exit
  865. $ exit
  866. $!----------------- cut here ------------------------------------
  867.  
  868. 2) With DECsound (bundled with motif)
  869.  
  870. Just start DECsound by selecting it from the session manager in the 
  871. applications menu. (Not there use "@vue$library:sound$vue_startup").
  872. Make sure settings; device type (vaxstation 4000) and play settings
  873. (headphone jack) are selected.  To play files from the DCL prompt 
  874. (handy if you want to play sounds on a remote workstation) set a 
  875. symbol up as follows; 
  876. PLAY == "$DECSOUND -VOLUME 50 -PLAY"
  877. usage;
  878. DCL> play sound.au
  879.  
  880. 3) Audio port
  881.  
  882. The external audio port comes with a telephone-jack-like port.   For
  883. starters, you can plug a telephone RECEIVER right into this port to
  884. hear your first sound files.   After that, you can use the adapter
  885. (that came with the VaxStation), and plug in a small set of stereo
  886. speakers or headphones (the kind you'd plug into a WALKMAN, for 
  887. example), for more volume.  The adapter also has a microphone plug so
  888. that you can record sounds if DECsound is installed.
  889.  
  890.  
  891. Playing audio files on micros
  892. -----------------------------
  893.  
  894. Most micros have at least a speaker built in, so theoretically all you
  895. need is the right software.  Unfortunately most systems don't come
  896. bundled with sound-playing software, so there are many public domain
  897. or shareware software packages, each with their own bugs and features.
  898. Most separate sound recording hardware also comes with playing
  899. software, most of which can play sound (in the file format used by
  900. that hardware) even on machines that don't have that hardware
  901. installed.
  902.  
  903.         PC or compatible
  904.         ----------------
  905.  
  906. Chris S. Craig announces the following software for PCs:
  907.  
  908. ScopeTrax       This is a complete PC sound player/editor package.  Sounds
  909.                 can be played back at ANY rate between 1kHz to 65kHz through
  910.                 the PC speaker or the Sound Blaster.  It supports several
  911.                 file formats including VOC, IFF/8SVX, raw signed and raw
  912.                 unsigned.  A separate executable is provided to convert
  913.                 .au and mu-law to raw format.  ScopeTrax requires EGA/VGA
  914.                 graphics for editing and displaying sounds on a REALTIME
  915.                 oscilloscope.  The package also includes:
  916.                       * An expanded memory player which can play sounds
  917.                         larger than 640K in size.
  918.                       * Basic (rough) sound compression/uncompression
  919.                         utilities.
  920.                       * Complete documentation.
  921.                 The package is FREEWARE!  It is available on SIMTEL in the
  922.                 PD1:[MSDOS.SOUND] directory.
  923.  
  924. One of the appendices below contains a list of more programs to play
  925. sound on the PC.
  926.  
  927.         Atari
  928.         -----
  929.  
  930. For sounds on Atari STs - programs are in the atari/sound/players
  931. directory on atari.archive.umich.edu (141.211.164.8).
  932.  
  933.         Tandy
  934.         -----
  935.  
  936. On a Tandy 1000, sounds can be played and recorded with DeskMate Sound
  937. (SOUND.PDM), or if they not stored in compressed format, they can also
  938. be played be a program called PLAYSND.  No indication of whether
  939. PLAYSND is PD or not. It hasn't been updated since March of 89.
  940.  
  941.         Amiga
  942.         -----
  943.  
  944. On the Amiga, OmniPlay by David Champion <dgc3@midway.uchicago.edu>
  945. plays and converts IFF-8SVX, AIFF, WAV, VOC, .au, .snd, and 8 bit raw
  946. (signed, unsigned, u-law) samples.  As of version 1.23, OmniPlay will
  947. also convert any playable sample to 8SVX.  Files: wuarchive.wustl.edu
  948. in /systems/amiga/audio/sampleplayers/oplay123.lha (?)
  949. amiga.physik.unizh.ch in mus/play/oplay123.lha
  950.  
  951.         Apple Macintosh
  952.         ---------------
  953.  
  954. Malcolm Slaney from Apple writes:
  955.  
  956.  "We do have tools to play sound back on most of our Unix hosts.  We wrote
  957.  a program called TcpPlay that lets us read a sound file on a Unix host,
  958.  open a TCP/IP connection to the Mac on my desk, and plays the file.  We
  959.  think of it as X windows for sound (at least a step in that direction.)
  960.  
  961.  This software is available for anonymous FTP from ftp.apple.com
  962.  [IP address 130.43.2.3 -- Guido].
  963.  Look for  ~ftp/pub/TcpPlay/TcpPlay.sit.hqx.
  964.  
  965.  Finally, there are MANY tools for working with sound on the Macintosh. Three
  966.  applications that come to mind immediately are SoundEdit (formerly by
  967.  Farralon and now by MacroMind/Paracomp), Alchemy and Eric Keller's Signalyze.
  968.  There are lots of other tools available for sound editing (including some
  969.  of the QuickTime Movie tools.)"
  970.  
  971. Bill Houle sent the following lists:
  972.  
  973. Popular commercial apps are indicated with a [*].  All other programs
  974. mentioned are shareware/freeware available from SUMEX and the various
  975. mirror sites, or check archie for the nearest FTP location.
  976.  
  977. MAC SOUND EDITORS
  978.  
  979. Sample Editor [Garrick McFarlane, McFarlaneGA@Kirk.Vax.Aston.Ac.UK]
  980.   Plays AIFF and 'snd' sounds.  Can convert between AIFF and 'snd'.
  981.   Can record from built-in mic.  Can add effects such as fade,
  982.   normalize, delay, etc.
  983.  
  984. Wavicle [Lee Fyock]
  985.   Plays SoundEdit files.  Can convert to 'snd'.  Can record from built-in mic.
  986.   Can add effects such as fade, filter, reverb, etc.
  987.  
  988. [*]SoundEdit/SoundEdit Pro [Farallon/MacroMind*Paracomp]
  989.   Plays SoundEdit and 'snd' sounds.  Can read/write SoundEdit files and 'snd' 
  990.   sounds.  Can record from built-in mic.  Can add effects such as
  991.   echo, filter, reverb, etc.
  992.  
  993.  
  994. MAC SOUND PLAYERS
  995.  
  996. Sound-Tracker  [Frank Seide]
  997.   Plays Amiga SoundTracker files in foreground or background.
  998.  
  999. Macintosh Tracker [Thomas R. Lawrance, tomlaw@world.std.com]
  1000.   Plays Amiga SoundTracker files in foreground or background. A port of Marc
  1001.   Espie's Unix Tracker version with Frank Seide's core player thrown in for
  1002.   good measure.
  1003.  
  1004. The Player [Antoine Rosset & Mike Venturi]
  1005.   Plays AIFF, SoundEdit, MOD, and 'snd' files.
  1006.  
  1007. SoundMaster (aka [*]Kaboom!) [Bruce Tomlin]
  1008.   Associates SoundEdit files to MacOS events.
  1009.  
  1010. SndControl [Riccardo Ettore, 72277.1344@compuserve.com]
  1011.   Associates 'snd' sounds to MacOS events.
  1012.  
  1013. Canon 2 [Glenn Anderson, glenn@otago.ac.nz; Jeff Home, jeff@otago.ac.nz]
  1014.   Plays AIFF or 'snd' files in foreground or background.
  1015.  
  1016. Another Mac play/convert program: "It's called SoundApp. I wrote it,
  1017. (franke1@llnl.gov) and it's FreeWare. It will play: SoundCap,
  1018. SoundEdit, WAVE, VOC, MOD, Amiga IFF (8SVX), Sound Designer, AIFF, AU,
  1019. Mac Resource, and DVI ADPCM. It can convert all the above to System 7
  1020. sound resources (except MOD where just the samples are extracted.) And
  1021. it will double buffer."
  1022.  
  1023.  
  1024. The Sound Site Newsletter
  1025. -------------------------
  1026.  
  1027. An electronic publication with lots of info about digitised sound and
  1028. sound formats, albeit mostly on PCs, is "The Sound Site Newsletter",
  1029. maintained by David Komatsu <davek@uhunix.uhcc.hawaii.edu>.
  1030. Issue 14 appeared in July 1993.  As of that issue, the Sound Site
  1031. Newsletter has expanded its charter to include commercial products and
  1032. will appear monthly.  There is now also a sound site network of ftp
  1033. servers, bulletin boards and authors.  The Sound Site Newsletter (once
  1034. again!) has its own ftp site: sound.usach.cl.
  1035.  
  1036. The Sound Newsletter is posted to: comp.sys.ibm.pc.soundcard
  1037.                                    comp.sys.ibm.pc.misc
  1038.                                    rec.games.misc
  1039. FTP: oak.oakland.edu (misc/sound)
  1040.      garbo.uwasa.fi (pc/sound)
  1041.      sound.usach.cl (pub/Sound/Newsltr) [Home Base]
  1042.  
  1043.  
  1044. Posting sounds
  1045. --------------
  1046.  
  1047. The newsgroup alt.binaries.sounds.misc is dedicated to postings
  1048. containing sound.  (Discussions related to such postings belong in
  1049. alt.binaries.sounds.d.)
  1050.  
  1051. There is no set standard for posting sounds; uuencoded files in most
  1052. popular formats are welcome, if split in parts under 50 kBytes.  To
  1053. accomodate automatic decoding software (such as the ":decode" command
  1054. of the nn newsreader), please place a part indicator of the form
  1055. (mm/nn) at the end of your subject meaning this is number mm of a
  1056. total of nn part.
  1057.  
  1058. It is recommended to post sounds in the format that was used for the
  1059. original recording; conversions to other formats often lose
  1060. information and would do people with identical hardware as the poster
  1061. no favor.  For instance, convering 8-bit linear sound to U-LAW loses
  1062. the lower few bits of the data, and rate changing conversions almost
  1063. always add noise.  Converting from U-LAW to linear requires expansion
  1064. to 16 bit samples if no information loss is allowed!
  1065.  
  1066. U-LAW data is best posted with a NeXT/Sun header.
  1067.  
  1068. If you have to post a file in a headerless format (usually 8-bit
  1069. linear, like ".snd"), please add a description giving at least the
  1070. sampling rate and whether the bytes are signed (zero at 0) or unsigned
  1071. (zero at 0200).  However, it is highly recommended to add a header
  1072. that indicates the sampling rate and encoding scheme; if necessary you
  1073. can use SOX to add a header of your choice to raw data.
  1074.  
  1075. Compression of sound files usually isn't worth it; the standard
  1076. "compress" algorithm doesn't save much when applied to sound data
  1077. (typically at most 10-20 percent), and compression algorithms
  1078. specifically designed for sound (e.g. NeXT's) are usually
  1079. proprietary.  (See also the section "Compression schemes" earlier.)
  1080.  
  1081. Archive-name: audio-fmts/part2
  1082. Submitted-by: Guido van Rossum <guido@cwi.nl>
  1083. Version: 3.05
  1084. Last-modified: 27-Sep-1993
  1085.  
  1086. Appendices
  1087. ==========
  1088.  
  1089. Here are some more detailed pieces of info that I received by e-mail.
  1090. They are reproduced here virtually without much editing.
  1091.  
  1092. Table of contents
  1093. -----------------
  1094.  
  1095. FTP access for non-internet sites
  1096. AIFF Format (Audio IFF)
  1097. The NeXT/Sun audio file format
  1098. IFF/8SVX Format
  1099. Playing sound on a PC
  1100. The EA-IFF-85 documentation
  1101. US Federal Standard 1016 availability
  1102. Creative Voice (VOC) file format
  1103. RIFF WAVE (.WAV) file format
  1104. U-LAW and A-LAW definitions
  1105. AVR File Format
  1106. The Amiga MOD Format
  1107.  
  1108. ------------------------------------------------------------------------
  1109. FTP access for non-internet sites
  1110. ---------------------------------
  1111.  
  1112. From the sci.space FAQ:
  1113.  
  1114.     Sites not connected to the Internet cannot use FTP directly, but
  1115.     there are a few automated FTP servers which operate via email.
  1116.     Send mail containing only the word HELP to ftpmail@decwrl.dec.com
  1117.     or bitftp@pucc.princeton.edu, and the servers will send you
  1118.     instructions on how to make requests.  (The bitftp service is no
  1119.     longer available through UUCP gateways due to complaints about
  1120.     overuse :-( )
  1121.  
  1122. Also:
  1123.  
  1124.     FAQ lists are available by anonymous FTP from rftm.mit.edu
  1125.     and by email from mail-server@rtfm.mit.edu (send a message
  1126.     containing "help" for instructions about the mail server).
  1127.  
  1128.  
  1129. ------------------------------------------------------------------------
  1130. AIFF Format (Audio IFF) and AIFC
  1131. --------------------------------
  1132.  
  1133. This format was developed by Apple for storing high-quality sampled
  1134. sound and musical instrument info; it is also used by SGI and several
  1135. professional audio packages (sorry, I know no names).  An extension,
  1136. called AIFC or AIFF-C, supports compression (see the last item below).
  1137.  
  1138. I've made a BinHex'ed MacWrite version of the AIFF spec (no idea if
  1139. it's the same text as mentioned below) available by anonymous ftp from
  1140. ftp.cwi.nl [192.16.184.180]; the file is /pub/audio/AudioIFF1.2.hqx.
  1141. A newer version is also available: /pub/audio/AudioIFF1.3.hqx.
  1142. But you may be better off with the AIFF-C specs, see below.
  1143.  
  1144. Mike Brindley (brindley@ece.orst.edu) writes:
  1145.  
  1146. "The complete AIFF spec by Steve Milne, Matt Deatherage (Apple) is
  1147. available in 'AMIGA ROM Kernal Reference Manual: Devices (3rd Edition)'
  1148. 1991 by Commodore-Amiga, Inc.; Addison-Wesley Publishing Co.; 
  1149. ISBN 0-201-56775-X, starting on page 435 (this edition has a charcoal
  1150. grey cover).  It is available in most bookstores, and soon in many
  1151. good librairies."
  1152.  
  1153. According to Mark Callow (msc@sgi.com):
  1154.  
  1155. A PostScript version of the AIFF-C specification is available via
  1156. anonymous ftp on FTP.SGI.COM (192.48.153.1) as /sgi/aiff-c.9.26.91.ps.
  1157.  
  1158. Benjamin Denckla <bdenckla@husc.harvard.edu> writes:
  1159.  
  1160. A piece of information that may be of some use to people who want to use
  1161. AIFF files with their Macintosh Think C programs:  AIFF data structures are
  1162. contained in the file AIFF.h in the "Apple #Includes" folder that comes
  1163. on the distribution disks.  I found this out a little too late: I had
  1164. already coded my own structures.  I assume that this header file comes
  1165. with Apple programming products like MPW [C|C++] as well.
  1166.  
  1167. An important file format for the Mac which is only mentioned once in the
  1168. FAQ is the Sound Designer II file format.  There is also an older Sound
  1169. Designer I format.  I have the SDII format in electronic form but I don't
  1170. think I'm at liberty to distribute it.  It can be obtained by applying to
  1171. become a 3rd Party Developer for Digidesign.  This process is simple
  1172. (1-page application) and free.  Call Digidesign at 415-688-0600 for
  1173. information.  The SDII file format is interesting in that all non-sample
  1174. data (sample rate, channels, etc.) is contained in the resource fork and
  1175. the data fork contains sample data only.
  1176.  
  1177. ------------------------------------------------------------------------
  1178. The NeXT/Sun audio file format
  1179. ------------------------------
  1180.  
  1181. Here's the complete story on the file format, from the NeXT
  1182. documentation.  (Note that the "magic" number is ((int)0x2e736e64),
  1183. which equals ".snd".)  Also, at the end, I've added a litte document
  1184. that someone posted to the net a couple of years ago, that describes
  1185. the format in a bit-by-bit fashion rather than from C.
  1186.  
  1187. I received this from Doug Keislar, NeXT Computer.  This is also the
  1188. Sun format, except that Sun doesn't recognize as many format codes.  I
  1189. added the numeric codes to the table of formats and sorted it.
  1190.  
  1191.  
  1192. SNDSoundStruct:  How a NeXT Computer Represents Sound
  1193.  
  1194. The NeXT sound software defines the SNDSoundStruct structure to  
  1195. represent sound.  This structure defines the soundfile and Mach-O  
  1196. sound segment formats and the sound pasteboard type.  It's also used  
  1197. to describe sounds in Interface Builder.  In addition, each instance  
  1198. of the Sound Kit's Sound class encapsulates a SNDSoundStruct and  
  1199. provides methods to access and modify its attributes.
  1200.  
  1201. Basic sound operations, such as playing, recording, and cut-and-paste  
  1202. editing, are most easily performed by a Sound object.  In many cases,  
  1203. the Sound Kit obviates the need for in-depth understanding of the  
  1204. SNDSoundStruct architecture.  For example, if you simply want to  
  1205. incorporate sound effects into an application, or to provide a simple  
  1206. graphic sound editor (such as the one in the Mail application), you  
  1207. needn't be aware of the details of the SNDSoundStruct.  However, if  
  1208. you want to closely examine or manipulate sound data you should be  
  1209. familiar with this structure.
  1210.  
  1211. The SNDSoundStruct contains a header, information that describes the  
  1212. attributes of a sound, followed by the data (usually samples) that  
  1213. represents the sound.  The structure is defined (in  
  1214. sound/soundstruct.h) as:
  1215.  
  1216. typedef struct {
  1217.     int magic;               /* magic number SND_MAGIC */
  1218.     int dataLocation;        /* offset or pointer to the data */
  1219.     int dataSize;            /* number of bytes of data */
  1220.     int dataFormat;          /* the data format code */
  1221.     int samplingRate;        /* the sampling rate */
  1222.     int channelCount;        /* the number of channels */
  1223.     char info[4];            /* optional text information */
  1224. } SNDSoundStruct;
  1225.  
  1226.  
  1227.  
  1228.  
  1229. SNDSoundStruct Fields
  1230.  
  1231.  
  1232.  
  1233. magic
  1234.  
  1235. magic is a magic number that's used to identify the structure as a  
  1236. SNDSoundStruct.  Keep in mind that the structure also defines the  
  1237. soundfile and Mach-O sound segment formats, so the magic number is  
  1238. also used to identify these entities as containing a sound.
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244. dataLocation
  1245.  
  1246. It was mentioned above that the SNDSoundStruct contains a header  
  1247. followed by sound data.  In reality, the structure only contains the  
  1248. header; the data itself is external to, although usually contiguous  
  1249. with, the structure.  (Nonetheless, it's often useful to speak of the  
  1250. SNDSoundStruct as the header and the data.)  dataLocation is used to  
  1251. point to the data.  Usually, this value is an offset (in bytes) from  
  1252. the beginning of the SNDSoundStruct to the first byte of sound data.   
  1253. The data, in this case, immediately follows the structure, so  
  1254. dataLocation can also be thought of as the size of the structure's  
  1255. header.  The other use of dataLocation, as an address that locates  
  1256. data that isn't contiguous with the structure, is described in  
  1257. "Format Codes," below.
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263. dataSize, dataFormat, samplingRate, and channelCount
  1264.  
  1265. These fields describe the sound data.
  1266.  
  1267. dataSize is its size in bytes (not including the size of the  
  1268. SNDSoundStruct).
  1269.  
  1270. dataFormat is a code that identifies the type of sound.  For sampled  
  1271. sounds, this is the quantization format.  However, the data can also  
  1272. be instructions for synthesizing a sound on the DSP.  The codes are  
  1273. listed and explained in "Format Codes," below.
  1274.  
  1275. samplingRate is the sampling rate (if the data is samples).  Three  
  1276. sampling rates, represented as integer constants, are supported by  
  1277. the hardware:
  1278.  
  1279. Constant        Sampling Rate (samples/sec) 
  1280.  
  1281. SND_RATE_CODEC  8012.821        (CODEC input)
  1282. SND_RATE_LOW    22050.0 (low sampling rate output)
  1283. SND_RATE_HIGH   44100.0 (high sampling rate output)
  1284.  
  1285. channelCount is the number of channels of sampled sound.
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291. info
  1292.  
  1293. info is a NULL-terminated string that you can supply to provide a  
  1294. textual description of the sound.  The size of the info field is set  
  1295. when the structure is created and thereafter can't be enlarged.  It's  
  1296. at least four bytes long (even if it's unused).
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302. Format Codes
  1303.  
  1304. A sound's format is represented as a positive 32-bit integer.  NeXT  
  1305. reserves the integers 0 through 255; you can define your own format  
  1306. and represent it with an integer greater than 255.  Most of the  
  1307. formats defined by NeXT describe the amplitude quantization of  
  1308. sampled sound data:
  1309.  
  1310. Value   Code    Format 
  1311.  
  1312. 0       SND_FORMAT_UNSPECIFIED  unspecified format 
  1313. 1       SND_FORMAT_MULAW_8      8-bit mu-law samples
  1314. 2       SND_FORMAT_LINEAR_8     8-bit linear samples
  1315. 3       SND_FORMAT_LINEAR_16    16-bit linear samples
  1316. 4       SND_FORMAT_LINEAR_24    24-bit linear samples
  1317. 5       SND_FORMAT_LINEAR_32    32-bit linear samples
  1318. 6       SND_FORMAT_FLOAT        floating-point samples
  1319. 7       SND_FORMAT_DOUBLE       double-precision float samples
  1320. 8       SND_FORMAT_INDIRECT     fragmented sampled data
  1321. 9       SND_FORMAT_NESTED       ?
  1322. 10      SND_FORMAT_DSP_CORE     DSP program
  1323. 11      SND_FORMAT_DSP_DATA_8   8-bit fixed-point samples
  1324. 12      SND_FORMAT_DSP_DATA_16  16-bit fixed-point samples
  1325. 13      SND_FORMAT_DSP_DATA_24  24-bit fixed-point samples
  1326. 14      SND_FORMAT_DSP_DATA_32  32-bit fixed-point samples
  1327. 15      ?
  1328. 16      SND_FORMAT_DISPLAY      non-audio display data
  1329. 17      SND_FORMAT_MULAW_SQUELCH        ?
  1330. 18      SND_FORMAT_EMPHASIZED   16-bit linear with emphasis
  1331. 19      SND_FORMAT_COMPRESSED   16-bit linear with compression
  1332. 20      SND_FORMAT_COMPRESSED_EMPHASIZED        A combination of the two above
  1333. 21      SND_FORMAT_DSP_COMMANDS Music Kit DSP commands
  1334. 22      SND_FORMAT_DSP_COMMANDS_SAMPLES         ?
  1335. [Some new ones supported by Sun.  This is all I currently know. --GvR]
  1336. 23      SND_FORMAT_ADPCM_G721
  1337. 24      SND_FORMAT_ADPCM_G722
  1338. 25      SND_FORMAT_ADPCM_G723_3
  1339. 26      SND_FORMAT_ADPCM_G723_5
  1340. 27      SND_FORMAT_ALAW_8
  1341.  
  1342.  
  1343. Most formats identify different sizes and types of  
  1344. sampled data.  Some deserve special note:  
  1345.  
  1346.  
  1347. --      SND_FORMAT_DSP_CORE format contains data that represents a  
  1348. loadable DSP core program.  Sounds in this format are required by the  
  1349. SNDBootDSP() and SNDRunDSP() functions.  You create a  
  1350. SND_FORMAT_DSP_CORE sound by reading a DSP load file (extension  
  1351. ".lod") with the SNDReadDSPfile() function.
  1352.  
  1353. --      SND_FORMAT_DSP_COMMANDS is used to distinguish sounds that  
  1354. contain DSP commands created by the Music Kit.  Sounds in this format  
  1355. can only be created through the Music Kit's Orchestra class, but can  
  1356. be played back through the SNDStartPlaying() function.
  1357.  
  1358. --      SND_FORMAT_DISPLAY format is used by the Sound Kit's  
  1359. SoundView class.  Such sounds can't be played.  
  1360.  
  1361.  
  1362. --      SND_FORMAT_INDIRECT indicates data that has become  
  1363. fragmented, as described in a separate section, below.  
  1364.  
  1365.  
  1366. --      SND_FORMAT_UNSPECIFIED is used for unrecognized formats.
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372. Fragmented Sound Data
  1373.  
  1374. Sound data is usually stored in a contiguous block of memory.   
  1375. However, when sampled sound data is edited (such that a portion of  
  1376. the sound is deleted or a portion inserted), the data may become  
  1377. discontiguous, or fragmented.  Each fragment of data is given its own  
  1378. SNDSoundStruct header; thus, each fragment becomes a separate  
  1379. SNDSoundStruct structure.  The addresses of these new structures are  
  1380. collected into a contiguous, NULL-terminated block; the dataLocation  
  1381. field of the original SNDSoundStruct is set to the address of this  
  1382. block, while the original format, sampling rate, and channel count  
  1383. are copied into the new SNDSoundStructs.  
  1384.  
  1385.  
  1386. Fragmentation serves one purpose:  It avoids the high cost of moving  
  1387. data when the sound is edited.  Playback of a fragmented sound is  
  1388. transparent-you never need to know whether the sound is fragmented  
  1389. before playing it.  However, playback of a heavily fragmented sound  
  1390. is less efficient than that of a contiguous sound.  The  
  1391. SNDCompactSamples() C function can be used to compact fragmented  
  1392. sound data.
  1393.  
  1394. Sampled sound data is naturally unfragmented.  A sound that's freshly  
  1395. recorded or retrieved from a soundfile, the Mach-O segment, or the  
  1396. pasteboard won't be fragmented.  Keep in mind that only sampled data  
  1397. can become fragmented.
  1398.  
  1399.  
  1400.  
  1401. _________________________
  1402. >From mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps Wed Apr  4  
  1403. 23:56:23 EST 1990
  1404. Article 5779 of comp.sys.next:
  1405. Path: mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps
  1406. >From: eps@toaster.SFSU.EDU (Eric P. Scott)
  1407. Newsgroups: comp.sys.next
  1408. Subject: Re: Format of NeXT sndfile headers?
  1409. Message-ID: <445@toaster.SFSU.EDU>
  1410. Date: 31 Mar 90 21:36:17 GMT
  1411. References: <14978@phoenix.Princeton.EDU>
  1412. Reply-To: eps@cs.SFSU.EDU (Eric P. Scott)
  1413. Organization: San Francisco State University
  1414. Lines: 42
  1415.  
  1416. In article <14978@phoenix.Princeton.EDU>
  1417.         bskendig@phoenix.Princeton.EDU (Brian Kendig) writes:
  1418. >I'd like to take a program I have that converts Macintosh sound  
  1419. files
  1420. >to NeXT sndfiles and polish it up a bit to go the other direction as
  1421. >well.
  1422.  
  1423. Two people have already submitted programs that do this
  1424. (Christopher Lane and Robert Hood); check the various
  1425. NeXT archive sites.
  1426.  
  1427. >       Could someone please give me the format of a NeXT sndfile
  1428. >header?
  1429.  
  1430. "big-endian"
  1431.         0       1       2       3
  1432.         +-------+-------+-------+-------+
  1433. 0       | 0x2e  | 0x73  | 0x6e  | 0x64  |       "magic" number
  1434.         +-------+-------+-------+-------+
  1435. 4       |                               |       data location
  1436.         +-------+-------+-------+-------+
  1437. 8       |                               |       data size
  1438.         +-------+-------+-------+-------+
  1439. 12      |                               |       data format (enum)
  1440.         +-------+-------+-------+-------+
  1441. 16      |                               |       sampling rate (int)
  1442.         +-------+-------+-------+-------+
  1443. 20      |                               |       channel count
  1444.         +-------+-------+-------+-------+
  1445. 24      |       |       |       |       |       (optional) info  
  1446. string
  1447.  
  1448. 28 = minimum value for data location
  1449.  
  1450. data format values can be found in /usr/include/sound/soundstruct.h
  1451.  
  1452. Most common combinations:
  1453.  
  1454.          sampling  channel    data
  1455.              rate    count  format              
  1456. voice file   8012        1       1 =  8-bit mu-law
  1457. system beep 22050        2       3 = 16-bit linear
  1458. CD-quality  44100        2       3 = 16-bit linear
  1459.  
  1460. ------------------------------------------------------------------------
  1461. IFF/8SVX Format
  1462. ---------------
  1463.  
  1464. Newsgroups: alt.binaries.sounds.d,alt.sex.sounds
  1465. Subject: Format of the IFF header (Amiga sounds)
  1466. Message-ID: <2509@tardis.Tymnet.COM>
  1467. From: jms@tardis.Tymnet.COM (Joe Smith)
  1468. Date: 23 Oct 91 23:54:38 GMT
  1469. Followup-To: alt.binaries.sounds.d
  1470. Organization: BT North America (Tymnet)
  1471.  
  1472. The first 12 bytes of an IFF file are used to distinguish between an Amiga
  1473. picture (FORM-ILBM), an Amiga sound sample (FORM-8SVX), or other file
  1474. conforming to the IFF specification.  The middle 4 bytes is the count of
  1475. bytes that follow the "FORM" and byte count longwords.  (Numbers are stored
  1476. in M68000 form, high order byte first.)
  1477.  
  1478.                 ------------------------------------------
  1479.  
  1480. FutureSound audio file, 15000 samples at 10.000KHz, file is 15048 bytes long.
  1481.  
  1482. 0000: 464F524D 00003AC0 38535658 56484452    FORM..:.8SVXVHDR
  1483.       F O R M     15040 8 S V X  V H D R
  1484. 0010: 00000014 00003A98 00000000 00000000    ......:.........
  1485.             20    15000        0        0
  1486. 0020: 27100100 00010000 424F4459 00003A98    '.......BODY..:.
  1487.      10000 1 0    1.0   B O D Y     15000
  1488.  
  1489. 0000000..03 = "FORM", identifies this as an IFF format file.
  1490. FORM+00..03 (ULONG) = number of bytes that follow.  (Unsigned long int.)
  1491. FORM+03..07 = "8SVX", identifies this as an 8-bit sampled voice.
  1492.  
  1493. ????+00..03 = "VHDR", Voice8Header, describes the parameters for the BODY.
  1494. VHDR+00..03 (ULONG) = number of bytes to follow. 
  1495. VHDR+04..07 (ULONG) = samples in the high octave 1-shot part.
  1496. VHDR+08..0B (ULONG) = samples in the high octave repeat part.
  1497. VHDR+0C..0F (ULONG) = samples per cycle in high octave (if repeating), else 0.
  1498. VHDR+10..11 (UWORD) = samples per second.  (Unsigned 16-bit quantity.)
  1499. VHDR+12     (UBYTE) = number of octaves of waveforms in sample.
  1500. VHDR+13     (UBYTE) = data compression (0=none, 1=Fibonacci-delta encoding).
  1501. VHDR+14..17 (FIXED) = volume.  (The number 65536 means 1.0 or full volume.)
  1502.  
  1503. ????+00..03 = "BODY", identifies the start of the audio data.
  1504. BODY+00..03 (ULONG) = number of bytes to follow.
  1505. BODY+04..NNNNN      = Data, signed bytes, from -128 to +127.
  1506.  
  1507. 0030: 04030201 02030303 04050605 05060605
  1508. 0040: 06080806 07060505 04020202 01FF0000
  1509. 0050: 00000000 FF00FFFF FFFEFDFD FDFEFFFF
  1510. 0060: FDFDFF00 00FFFFFF 00000000 00FFFF00
  1511. 0070: 00000000 00FF0000 00FFFEFF 00000000
  1512. 0080: 00010000 000101FF FF0000FE FEFFFFFE
  1513. 0090: FDFDFEFD FDFFFFFC FDFEFDFD FEFFFEFE
  1514. 00A0: FFFEFEFE FEFEFEFF FFFFFEFF 00FFFF01
  1515.  
  1516. This small section of the audio sample shows the number ranging from -5 (0xFD)
  1517. to +8 (0x08).  Warning: Do not assume that the BODY starts 48 bytes into the
  1518. file.  In addition to "VHDR", chunks labeled "NAME", "AUTH", "ANNO", or 
  1519. "(c) " may be present, and may be in any order.  You will have to check the
  1520. byte count in each chunk to determine how many bytes to skip.
  1521.  
  1522. ------------------------------------------------------------------------
  1523. Playing sound on a PC
  1524. ---------------------
  1525.  
  1526. From: Eric A Rasmussen
  1527.  
  1528. Any turbo PC (8088 at 8 Mhz or greater)/286/386/486/etc. can produce a quality
  1529. playback of single channel 8 bit sounds on the internal (1 bit, 1 channel)
  1530. speaker by utilizing Pulse-Width-Modulation, which toggles the speaker faster
  1531. than it can physically move to simulate positions between fully on and fully
  1532. off.  There are several PD programs of this nature that I know of:
  1533.  
  1534. REMAC  - Plays MAC format sound files.  Files on the Macintosh, at least the
  1535.          sound files that I've ripped apart, seem to contain 3 parts.  The
  1536.          first two are info like what the file icon looks like and other
  1537.          header type info.  The third part contains the raw sample data, and
  1538.          it is this portion of the file which is saved to a seperate file,
  1539.          often named with the .snd extension by PC users.  Personally, I like
  1540.          to name the files .s1, .s2, .s3, or .s4 to indicate the sampling rate
  1541.          of the file. (-s# is how to specify the playback rate in REMAC.)
  1542.          REMAC provides playback rates of 5550hz, 7333hz, 11 khz, & 22 khz.
  1543. REMAC2 - Same as REMAC, but sounds better on higher speed machines.
  1544. REPLAY - Basically same as REMAC, but for playback of Atari ST sounds. 
  1545.          Apparently, the Atari has two sound formats, one of which sounds like
  1546.          garbage if played by REMAC or REPLAY in the incorrect mode.  The
  1547.          other file format works fine with REMAC and so appears to be 'normal'
  1548.          unsigned 8-bit data.  REPLAY provides playback rates of 11.5 khz,
  1549.          12.5 khz, 14 khz, 16 khz, 18.5 khz, 22khz, & 27 khz.
  1550.  
  1551. These three programs are all by the same author, Richard E. Zobell who does
  1552. not have an internet mail address to my knowledge, but does have a GEnie email
  1553. address of R.ZOBELL. 
  1554.  
  1555. Additionally, there are various stand-alone demos which use the internal
  1556. speaker, of which there is one called mushroom which plays a 30 second
  1557. advertising jingle for magic mushroom room deoderizers which is pretty
  1558. humerous.  I've used this player to playback samples that I ripped out of the
  1559. commercial game program Mean Streets, which uses something they call RealSound
  1560. (tm) to playback digital samples on the internal speaker. (Of course, I only do
  1561. this on my own system, and since I own the game, I see no problems with it.)
  1562.  
  1563. For owners of 8 Mhz 286's and above, the option to play 4 channel 8 bit sounds
  1564. (with decent quality) on the internal speaker is also a reality.  Quite a
  1565. number of PD programs exist to do this, including, but not limited to:
  1566.  
  1567. ModEdit, ModPlay, ScreamTracker, STM, Star Trekker, Tetra, and probably a few
  1568. more.  
  1569.  
  1570. All these programs basically make use of various sound formats used by the
  1571. Amiga line of computers.  These include .stm files, .mod files
  1572. [a.k.a. mod. files], and .nst files [really the same hing].  Also,
  1573. these programs pretty much all have the option to playback the 
  1574. sound to add-on hardware such as the SoundBlaster card, the Covox series of
  1575. devices, and also to direct the data to either one or two (for stereo)
  1576. parallel ports, which you could attach your own D/A's to.  (From what I have
  1577. seen, the Covox is basically an small amplified speaker with a D/A which plugs
  1578. into the parallel port.  This sounds very similiar to the Disney Sound System
  1579. (DSS) which people have been talking about recently.)  
  1580.  
  1581. ------------------------------------------------------------------------
  1582. The EA-IFF-85 documentation
  1583. ---------------------------
  1584.  
  1585. From: dgc3@midway.uchicago.edu
  1586.  
  1587. As promised, here's an ftp location for the EA-IFF-85 documentation.  It's
  1588. the November 1988 release as revised by Commodore (the last public release),
  1589. with specifications for IFF FORMs for graphics, sound, formatted text, and
  1590. more.  IFF FORMS now exist for other media, including structured drawing, and
  1591. new documentation is now available only from Commodore.
  1592.  
  1593. The documentation is at grind.isca.uiowa.edu [128.255.19.233], in the
  1594. directory /amiga/f1/ff185.  The complete file list is as follows:
  1595.  
  1596. DOCUMENTS.zoo    
  1597. EXAMPLES.zoo     
  1598. EXECUTABLE.zoo   
  1599. INCLUDE.zoo      
  1600. LINKER_INFO.zoo  
  1601. OBJECT.zoo       
  1602. SOURCE.zoo       
  1603. TP_IFF_Specs.zoo 
  1604.  
  1605. All files except DOCUMENTS.zoo are Amiga-specific, but may be used as a basis
  1606. for conversion to other platforms.  Well, I take that tentatively back.  I
  1607. don't know what TP_IFF_Specs.zoo contains, so it might be non-Amiga-specific.
  1608.  
  1609. ------------------------------------------------------------------------
  1610. US Federal Standard 1016 availability
  1611. -------------------------------------
  1612.  
  1613. From: jpcampb@afterlife.ncsc.mil (Joe Campbell)
  1614.  
  1615. The U.S. DoD's Federal-Standard-1016 based 4800 bps code excited linear
  1616. prediction voice coder version 3.2 (CELP 3.2) Fortran and C simulation
  1617. source codes are available for worldwide distribution (on DOS
  1618. diskettes, but configured to compile on Sun SPARC stations) from NTIS
  1619. and DTIC.  Example input and processed speech files are included.  A
  1620. Technical Information Bulletin (TIB), "Details to Assist in
  1621. Implementation of Federal Standard 1016 CELP," and the official
  1622. standard, "Federal Standard 1016, Telecommunications:  Analog to
  1623. Digital Conversion of Radio Voice by 4,800 bit/second Code Excited
  1624. Linear Prediction (CELP)," are also available.
  1625.  
  1626. This is available through the National Technical Information Service:
  1627.  
  1628. NTIS
  1629. U.S. Department of Commerce
  1630. 5285 Port Royal Road
  1631. Springfield, VA  22161
  1632. USA
  1633. (703) 487-4650
  1634.  
  1635. The "AD" ordering number for the CELP software is AD M000 118
  1636. (US$ 90.00) and for the TIB it's AD A256 629 (US$ 17.50).  The LPC-10
  1637. standard, described below, is FIPS Pub 137 (US$ 12.50).  There is a
  1638. $3.00 shipping charge on all U.S. orders.  The telephone number for
  1639. their automated system is 703-487-4650, or 703-487-4600 if you'd prefer
  1640. to talk with a real person.
  1641.  
  1642. (U.S. DoD personnel and contractors can receive the package from the
  1643. Defense Technical Information Center:  DTIC, Building 5, Cameron
  1644. Station, Alexandria, VA 22304-6145.  Their telephone number is
  1645. 703-274-7633.)
  1646.  
  1647. The following articles describe the Federal-Standard-1016 4.8-kbps CELP
  1648. coder (it's unnecessary to read more than one):
  1649.  
  1650. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  1651. "The Federal Standard 1016 4800 bps CELP Voice Coder," Digital Signal
  1652. Processing, Academic Press, 1991, Vol. 1, No. 3, p. 145-155.
  1653.  
  1654. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  1655. "The DoD 4.8 kbps Standard (Proposed Federal Standard 1016),"
  1656. in Advances in Speech Coding, ed. Atal, Cuperman and Gersho,
  1657. Kluwer Academic Publishers, 1991, Chapter 12, p. 121-133.
  1658.  
  1659. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
  1660. Proposed Federal Standard 1016 4800 bps Voice Coder:  CELP," Speech
  1661. Technology Magazine, April/May 1990, p. 58-64.
  1662.  
  1663.  
  1664. The U.S. DoD's Federal-Standard-1015/NATO-STANAG-4198 based 2400 bps
  1665. linear prediction coder (LPC-10) was republished as a Federal
  1666. Information Processing Standards Publication 137 (FIPS Pub 137).
  1667. It is described in:
  1668.  
  1669. Thomas E. Tremain, "The Government Standard Linear Predictive Coding
  1670. Algorithm:  LPC-10," Speech Technology Magazine, April 1982, p. 40-49.
  1671.  
  1672. There is also a section about FS-1015 in the book:
  1673. Panos E. Papamichalis, Practical Approaches to Speech Coding,
  1674. Prentice-Hall, 1987.
  1675.  
  1676. The voicing classifier used in the enhanced LPC-10 (LPC-10e) is described in:
  1677. Campbell, Joseph P., Jr. and T. E. Tremain, "Voiced/Unvoiced Classification
  1678. of Speech with Applications to the U.S. Government LPC-10E Algorithm,"
  1679. Proceedings of the IEEE International Conference on Acoustics, Speech, and
  1680. Signal Processing, 1986, p. 473-6.
  1681.  
  1682. Copies of the official standard
  1683. "Federal Standard 1016, Telecommunications: Analog to Digital Conversion
  1684. of Radio Voice by 4,800 bit/second Code Excited Linear Prediction (CELP)"
  1685. are available for US$ 5.00 each from:
  1686.  
  1687. GSA Federal Supply Service Bureau
  1688. Specification Section, Suite 8100
  1689. 470 E. L'Enfant Place, S.W.
  1690. Washington, DC  20407
  1691. (202)755-0325
  1692.  
  1693. Realtime DSP code for FS-1015 and FS-1016 is sold by:
  1694.  
  1695. John DellaMorte
  1696. DSP Software Engineering
  1697. 165 Middlesex Tpk, Suite 206
  1698. Bedford, MA  01730
  1699. USA
  1700. 1-617-275-3733
  1701. 1-617-275-4323 (fax)
  1702. dspse.bedford@channel1.com
  1703.  
  1704. DSP Software Engineering's FS-1016 code can run on a DSP Research's Tiger 30
  1705. (a PC board with a TMS320C3x and analog interface suited to development work).
  1706.  
  1707. DSP Research                
  1708. 1095 E. Duane Ave.          
  1709. Sunnyvale, CA  94086        
  1710. USA
  1711. (408)773-1042               
  1712. (408)736-3451 (fax)         
  1713.  
  1714. From: cfreese@super.org (Craig F. Reese)
  1715. Newsgroups: comp.speech,comp.dsp,comp.compression.research
  1716. Subject: CELP 3.2a release now available
  1717. Organization: Supercomputing Research Center (Bowie, MD)
  1718. Date: Tue, 3 Aug 1993 14:55:25 GMT
  1719.  
  1720. 3 August 1993
  1721.  
  1722. CELP 3.2a Release
  1723.  
  1724. Dear CELPers,
  1725.  
  1726. We have placed an updated version of the FS-1016 CELP 3.2 code in the
  1727. anonymous FTP area on super.org (192.31.192.1).  It's in:
  1728.  
  1729.   /pub/celp_3.2a.tar.Z (please be sure to do the ftp in binary mode).
  1730.  
  1731. This is essentially the PC release that was on fumar, except that we
  1732. started directly from the PC disks.  The value added is that we have
  1733. made over 69 corrections and fixes.  Most of these were necessary
  1734. because of the 8 character file name limit on DOS, but there are some
  1735. others, as well.
  1736.  
  1737. The code (C, FORTRAN, diskio) all has been built and tested on a Sun4
  1738. under SunOS4.1.3.  If you want to run it somewhere else, then you may
  1739. have to do a bit of work.  (A Solaris 2.x-compatible release is
  1740. planned soon.)
  1741.  
  1742. [One note to PCers.  The files:
  1743. [
  1744. [       cbsearch.F celp.F csub.F mexcite.F psearch.F
  1745. [
  1746. [are meant to be passed through the C preprocessor (cpp).
  1747. [We gather that DOS (or whatever it's called) can't distinguish 
  1748. [the .F from a .f.  Be careful!
  1749.  
  1750. Very limited support is available from the authors (Joe, et al.).
  1751. Please do not send questions or suggestions without first reading the
  1752. documentation (README files, the Technical Information Bulletin, etc.).
  1753. The authors would enjoy hearing from you, but they have limited time
  1754. for support and would like to use it as efficiently as possible.  They
  1755. welcome bug reports, but, again, please read the documentation first.
  1756. All users of FS-1016 CELP software are strongly encouraged to acquire
  1757. the latest release (version 3.2a as of this writing).
  1758.  
  1759. We do not know how long we will be able to leave the software on this
  1760. site, but it should be _at_least_ through 1 October 1993 (if you find
  1761. it missing, please drop me (Craig) a note).  Please try to get the
  1762. software during off hours (8 p.m. - 7 a.m. Eastern Standard time) or
  1763. folks here might complain and we'll have to get rid of the code (if
  1764. that happens, we'll try to pass it on to someone else, who can put it
  1765. on the net).  We would be more than happy for someone to copy it and
  1766. make it available elsewhere.
  1767.  
  1768. Good Luck,
  1769.  
  1770. Craig F. Reese  (cfreese@super.org)
  1771. IDA/Supercomputing Research Center
  1772.  
  1773. Joe Campbell (jpcampb@afterlife.ncsc.mil)
  1774. Department of Defense
  1775.  
  1776. P.S.  Just so you all know, I (Craig) am not actually involved in
  1777. CELP work.  I mainly got with Joe to help make the software available
  1778. on the Internet.  In the course of doing so, I cleaned up much of it,
  1779. but I am not, by any stretch, a CELP expert and will most likely
  1780. be unable to answer any technical questions concerning it. ;^)
  1781.  
  1782. From: tobiasr@monolith.lrmsc.loral.com (Richard Tobias)
  1783.  
  1784. For U.S. FED-STD-1016 (4800 bps CELP) _realtime_ DSP code and
  1785. information about products using this code using the AT&T DSP32C and
  1786. AT&T DSP3210, contact:
  1787.  
  1788. White Eagle Systems Technology, Inc.
  1789. 1123 Queensbridge Way
  1790. San Jose, CA 95120
  1791. (408) 997-2706
  1792. (408) 997-3584 (fax)
  1793. rjjt@netcom.com
  1794.  
  1795. From: Cole Erskine <cole@analogical.com>
  1796.  
  1797. [paraphrased]
  1798.  
  1799. Analogical Systems has a _real-time_ multirate implementation of U.S.
  1800. Federal Standard 1016 CELP operating at bit rates of 4800, 7200, and
  1801. 9600 bps on a single 27MHz Motorola DSP56001. Source and object code
  1802. is available for a one-time license fee.
  1803.  
  1804. FREE, _real-time_ demonstration software for the Ariel PC-56D is
  1805. available for those who already have such a board by contacting
  1806. Analogical Systems.  The demo software allows you to record and
  1807. playback CELP files to and from the PC's hard disk.
  1808.  
  1809. Analogical Systems
  1810. 2916 Ramona Street
  1811. Palo Alto, CA 94306
  1812. Tel: +1 (415) 323-3232
  1813. FAX: +1 (415) 323-4222
  1814.  
  1815. ------------------------------------------------------------------------
  1816. Creative Voice (VOC) file format
  1817. --------------------------------
  1818.  
  1819. From: galt@dsd.es.com
  1820.  
  1821. (byte numbers are hex!)
  1822.  
  1823.     HEADER (bytes 00-19)
  1824.     Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block]
  1825.  
  1826. - ---------------------------------------------------------------
  1827.  
  1828. HEADER:
  1829. =======
  1830.      byte #     Description
  1831.      ------     ------------------------------------------
  1832.      00-12      "Creative Voice File"
  1833.      13         1A (eof to abort printing of file)
  1834.      14-15      Offset of first datablock in .voc file (std 1A 00
  1835.                 in Intel Notation)
  1836.      16-17      Version number (minor,major) (VOC-HDR puts 0A 01)
  1837.      18-19      2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)
  1838.  
  1839. - ---------------------------------------------------------------
  1840.  
  1841. DATA BLOCK:
  1842. ===========
  1843.  
  1844.    Data Block:  TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)
  1845.    NOTE: Terminator Block is an exception -- it has only the TYPE byte.
  1846.  
  1847.       TYPE   Description     Size (3-byte int)   Info
  1848.       ----   -----------     -----------------   -----------------------
  1849.       00     Terminator      (NONE)              (NONE)
  1850.       01     Sound data      2+length of data    *
  1851.       02     Sound continue  length of data      Voice Data
  1852.       03     Silence         3                   **
  1853.       04     Marker          2                   Marker# (2 bytes)
  1854.       05     ASCII           length of string    null terminated string
  1855.       06     Repeat          2                   Count# (2 bytes)
  1856.       07     End repeat      0                   (NONE)
  1857.       08     Extended        4                   ***
  1858.  
  1859.       *Sound Info Format:       **Silence Info Format:
  1860.        ---------------------      ----------------------------
  1861.        00   Sample Rate           00-01  Length of silence - 1
  1862.        01   Compression Type      02     Sample Rate
  1863.        02+  Voice Data
  1864.  
  1865.     ***Extended Info Format:
  1866.        ---------------------
  1867.        00-01  Time Constant: Mono: 65536 - (256000000/sample_rate)
  1868.                              Stereo: 65536 - (25600000/(2*sample_rate))
  1869.        02     Pack
  1870.        03     Mode: 0 = mono
  1871.                     1 = stereo
  1872.  
  1873.  
  1874.   Marker#           -- Driver keeps the most recent marker in a status byte
  1875.   Count#            -- Number of repetitions + 1
  1876.                          Count# may be 1 to FFFE for 0 - FFFD repetitions
  1877.                          or FFFF for endless repetitions
  1878.   Sample Rate       -- SR byte = 256-(1000000/sample_rate)
  1879.   Length of silence -- in units of sampling cycle
  1880.   Compression Type  -- of voice data
  1881.                          8-bits    = 0
  1882.                          4-bits    = 1
  1883.                          2.6-bits  = 2
  1884.                          2-bits    = 3
  1885.                          Multi DAC = 3+(# of channels) [interesting--
  1886.                                        this isn't in the developer's manual]
  1887.  
  1888. ------------------------------------------------------------------------
  1889. RIFF WAVE (.WAV) file format
  1890. ----------------------------
  1891.  
  1892. RIFF is a format by Microsoft and IBM which is similar in spirit and
  1893. functionality as EA-IFF-85, but not compatible (and it's in
  1894. little-endian byte order, of course :-).  WAVE is RIFF's equivalent of
  1895. AIFF, and its inclusion in Microsoft Windows 3.1 has suddenly made it
  1896. important to know about.
  1897.  
  1898. Rob Ryan was kind enough to send me a description of the RIFF format.
  1899. Unfortunately, it is too big to include here (27 k), but I've made it
  1900. available for anonymous ftp as ftp.cwi.nl:/pub/audio/RIFF-format.
  1901.  
  1902. And here's a pointer to the official description from Matt Saettler,
  1903. Microsoft Multimedia:
  1904.  
  1905. "The complete definition of the WAVE file format as defined by
  1906. IBM/Microsoft is available for anon. FTP from ftp.uu.net in the
  1907. vendor/microsoft/multimedia directory."
  1908.  
  1909. (Rob Ryan's version may actually be an extract from one of the files
  1910. stored there.)
  1911.  
  1912. ------------------------------------------------------------------------
  1913. U-LAW and A-LAW definitions
  1914. ---------------------------
  1915.  
  1916. [Adapted from information provided by duggan@cc.gatech.edu (Rick
  1917. Duggan) and davep@zenobia.phys.unsw.EDU.AU (David Perry)]
  1918.  
  1919. u-LAW (really mu-LAW) is
  1920.  
  1921.           sgn(m)   (     |m |)       |m |
  1922.    y=    ------- ln( 1+ u|--|)       |--| =< 1
  1923.          ln(1+u)   (     |mp|)       |mp|         
  1924.  
  1925. A-LAW is
  1926.  
  1927.      |     A    (m )                 |m |    1
  1928.      |  ------- (--)                 |--| =< - 
  1929.      |  1+ln A  (mp)                 |mp|    A     
  1930.    y=|
  1931.      | sgn(m) (        |m |)    1    |m |
  1932.      | ------ ( 1+ ln A|--|)    - =< |--| =< 1
  1933.      | 1+ln A (        |mp|)    A    |mp|         
  1934.  
  1935. Values of u=100 and 255, A=87.6, mp is the Peak message value, m is
  1936. the current quantised message value.  (The formulae get simpler if you
  1937. substitute x for m/mp and sgn(x) for sgn(m); then -1 <= x <= 1.)
  1938.  
  1939. Converting from u-LAW to A-LAW is in a sense "lossy" since there are
  1940. quantizing errors introduced in the conversion.
  1941.  
  1942. "..the u-LAW used in North America and Japan, and the
  1943. A-LAW used in Europe and the rest of the world and
  1944. international routes.."
  1945.  
  1946. References:
  1947.  
  1948. Modern Digital and Analog Communication Systems, B.P.Lathi., 2nd ed.
  1949. ISBN 0-03-027933-X
  1950.  
  1951. Transmission Systems for Communications
  1952. Fifth Edition
  1953. by Members of the Technical Staff at Bell Telephone Laboratories
  1954. Bell Telephone Laboratories, Incorporated
  1955. Copyright 1959, 1964, 1970, 1982
  1956.  
  1957. A note on the resolution of U-LAW by Frank Klemm <pfk@rz.uni-jena.de>:
  1958.  
  1959. 8 bit U-LAW has the same lowest  magnitude like 12 bit linear and 12 bit
  1960. U-LAW like 16 linear.
  1961.  
  1962. Device/Coding   Resolution              Resolution
  1963.                 on maximal level        on low level
  1964.  8 bit linear    8                       8
  1965.  8 bit ulaw      6                      12      (used for digital telephone)
  1966. 12 bit linear   12                      12
  1967. 12 bit ulaw     10                      16      (used in DAT/Longplay)
  1968. 16 bit linear   16                      16
  1969.  
  1970. estimated for some analoge technique:
  1971. tape recorder (HiFi DIN)
  1972.                  8                       9      (no Problem today)
  1973. tape recorder (semiprofessional)
  1974.                 10.5                    13.5 
  1975.  
  1976. ------------------------------------------------------------------------
  1977. AVR File Format
  1978. ---------------
  1979.  
  1980. From: hyc@hanauma.Jpl.Nasa.Gov (Howard Chu)
  1981.  
  1982. A lot of PD software exists to play Mac .snd files on the ST. One other
  1983. format that seems pretty popular (used by a number of commercial packages)
  1984. is the AVR format (from Audio Visual Research). This format has a 128 byte
  1985. header that looks like this:
  1986.  
  1987.         char magic[4]="2BIT";
  1988.         char name[8];           /* null-padded sample name */
  1989.         short mono;             /* 0 = mono, 0xffff = stereo */
  1990.         short rez;              /* 8 = 8 bit, 16 = 16 bit */
  1991.         short sign;             /* 0 = unsigned, 0xffff = signed */
  1992.         short loop;             /* 0 = no loop, 0xffff = looping sample */
  1993.         short midi;             /* 0xffff = no MIDI note assigned,
  1994.                                    0xffXX = single key note assignment
  1995.                                    0xLLHH = key split, low/hi note */
  1996.         long rate;              /* sample frequency in hertz */
  1997.         long size;              /* sample length in bytes or words (see rez) */
  1998.         long lbeg;              /* offset to start of loop in bytes or words.
  1999.                                    set to zero if unused. */
  2000.         long lend;              /* offset to end of loop in bytes or words.
  2001.                                    set to sample length if unused. */
  2002.         short res1;             /* Reserved, MIDI keyboard split */
  2003.         short res2;             /* Reserved, sample compression */
  2004.         short res3;             /* Reserved */
  2005.         char ext[20];           /* Additional filename space, used
  2006.                                    if (name[7] != 0) */
  2007.         char user[64];          /* User defined. Typically ASCII message. */
  2008.  
  2009. -----------------------------------------------------------------------
  2010. The Amiga MOD Format
  2011. --------------------
  2012.  
  2013. From: norlin@mailhost.ecn.uoknor.edu (Norman Lin)
  2014.  
  2015. MOD files are music files containing 2 parts:
  2016.  
  2017. (1) a bank of digitized samples
  2018. (2) sequencing information describing how and when to play the samples
  2019.  
  2020. MOD files originated on the Amiga, but because of their flexibility
  2021. and the extremely large number of MOD files available, MOD players
  2022. are now available for a variety of machines (IBM PC, Mac, Sparc
  2023. Station, etc.)
  2024.  
  2025. The samples in a MOD file are raw, 8 bit, signed, headerless, linear
  2026. digital data.  There may be up to 31 distinct samples in a MOD file,
  2027. each with a length of up to 128K (though most are much smaller; say,
  2028. 10K - 60K).  An older MOD format only allowed for up to 15 samples in
  2029. a MOD file; you don't see many of these anymore.  There is no standard
  2030. sampling rate for these samples.  [But see below.]
  2031.  
  2032. The sequencing information in a MOD file contains 4 tracks of
  2033. information describing which, when, for how long, and at what frequency
  2034. samples should be played.  This means that a MOD file can have up
  2035. to 31 distinct (digitized) instrument sounds, with up to 4 playing
  2036. simultaneously at any given point.  This allows a wide variety
  2037. of orchestrational possibilities, including use of voice samples
  2038. or creation of one's own instruments (with appropriate sampling
  2039. hardware/software).  The ability to use one's own samples as instruments
  2040. is a flexibility that other music files/formats do not share, and
  2041. is one of the reasons MOD files are so popular, numerous, and diverse.
  2042.  
  2043. 15 instrument MODs, as noted above, are somewhat older than 31
  2044. instrument MODs and are not (at least not by me) seen very often
  2045. anymore.  Their format is identical to that of 31 instrument MODs
  2046. except:
  2047.  
  2048. (1) Since there are only 15 samples, the information for the last (15th)
  2049.     sample starts at byte 440 and goes through byte 469.
  2050. (2) The songlength is at byte 470 (contrast with byte 950 in 31 instrument
  2051.     MOD)
  2052. (3) Byte 471 appears to be ignored, but has been observed to be 127.
  2053.     (Sorry, this is from observation only)
  2054. (4) Byte 472 begins the pattern sequence table (contrast with byte 952
  2055.     in a 31 instrument MOD)
  2056. (5) Patterns start at byte 600 (contrast with byte 1084 in 31 instrument MOD)
  2057.  
  2058. "ProTracker," an Amiga MOD file creator/editor, is available for ftp
  2059. everywhere as pt??.lzh.
  2060.  
  2061. From: Apollo Wong <apollo@ee.ualberta.ca>
  2062.  
  2063. From: M.J.H.Cox@bradford.ac.uk (Mark Cox)
  2064. Newsgroups: alt.sb.programmer
  2065. Subject: Re: Format for MOD files...
  2066. Message-ID: <1992Mar18.103608.4061@bradford.ac.uk>
  2067. Date: 18 Mar 92 10:36:08 GMT
  2068. Organization: University of Bradford, UK
  2069.  
  2070. wdc50@DUTS.ccc.amdahl.com (Winthrop D Chan) writes:
  2071. >I'd like to know if anyone has a reference document on the format of the
  2072. >Amiga Sound/NoiseTracker (MOD) files. The author of Modplay said he was going
  2073. >to release such a document sometime last year, but he never did. If anyone
  2074.  
  2075. I found this one, which covers it better than I can explain it - if you
  2076. use this in conjunction with the documentation that comes with Norman
  2077. Lin's Modedit program it should pretty much cover it.
  2078.  
  2079. Mark J Cox
  2080.  
  2081. /***********************************************************************
  2082.  
  2083. Protracker 1.1B Song/Module Format:
  2084. -----------------------------------
  2085.  
  2086. Offset  Bytes  Description
  2087. ------  -----  -----------
  2088.    0     20    Songname. Remember to put trailing null bytes at the end...
  2089.  
  2090. Information for sample 1-31:
  2091.  
  2092. Offset  Bytes  Description
  2093. ------  -----  -----------
  2094.   20     22    Samplename for sample 1. Pad with null bytes.
  2095.   42      2    Samplelength for sample 1. Stored as number of words.
  2096.                Multiply by two to get real sample length in bytes.
  2097.   44      1    Lower four bits are the finetune value, stored as a signed
  2098.                four bit number. The upper four bits are not used, and
  2099.                should be set to zero.
  2100.                Value:  Finetune:
  2101.                  0        0
  2102.                  1       +1
  2103.                  2       +2
  2104.                  3       +3
  2105.                  4       +4
  2106.                  5       +5
  2107.                  6       +6
  2108.                  7       +7
  2109.                  8       -8
  2110.                  9       -7
  2111.                  A       -6
  2112.                  B       -5
  2113.                  C       -4
  2114.                  D       -3
  2115.                  E       -2
  2116.                  F       -1
  2117.  
  2118.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  2119.   46      2    Repeat point for sample 1. Stored as number of words offset
  2120.                from start of sample. Multiply by two to get offset in bytes.
  2121.   48      2    Repeat Length for sample 1. Stored as number of words in
  2122.                loop. Multiply by two to get replen in bytes.
  2123.  
  2124. Information for the next 30 samples starts here. It's just like the info for
  2125. sample 1.
  2126.  
  2127. Offset  Bytes  Description
  2128. ------  -----  -----------
  2129.   50     30    Sample 2...
  2130.   80     30    Sample 3...
  2131.    .
  2132.    .
  2133.    .
  2134.  890     30    Sample 30...
  2135.  920     30    Sample 31...
  2136.  
  2137. Offset  Bytes  Description
  2138. ------  -----  -----------
  2139.  950      1    Songlength. Range is 1-128.
  2140.  951      1    Well... this little byte here is set to 127, so that old
  2141.                trackers will search through all patterns when loading.
  2142.                Noisetracker uses this byte for restart, but we don't.
  2143.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  2144.                tells the tracker what pattern to play at that position.
  2145. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  2146.                inserted when they increased the number of samples from
  2147.                15 to 31. If it's not there, the module/song uses 15 samples
  2148.                or the text has been removed to make the module harder to
  2149.                rip. Startrekker puts "FLT4" or "FLT8" there instead.
  2150.  
  2151. Offset  Bytes  Description
  2152. ------  -----  -----------
  2153. 1084    1024   Data for pattern 00.
  2154.    .
  2155.    .
  2156.    .
  2157. xxxx  Number of patterns stored is equal to the highest patternnumber
  2158.       in the song position table (at offset 952-1079).
  2159.  
  2160. Each note is stored as 4 bytes, and all four notes at each position in
  2161. the pattern are stored after each other.
  2162.  
  2163. 00 -  chan1  chan2  chan3  chan4
  2164. 01 -  chan1  chan2  chan3  chan4
  2165. 02 -  chan1  chan2  chan3  chan4
  2166. etc.
  2167.  
  2168. Info for each note:
  2169.  
  2170.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  2171. /                \ /      \  /                \ /      \
  2172. 0000          0000-00000000  0000          0000-00000000
  2173.  
  2174. Upper four    12 bits for    Lower four    Effect command.
  2175. bits of sam-  note period.   bits of sam-
  2176. ple number.                  ple number.
  2177.  
  2178. Periodtable for Tuning 0, Normal
  2179.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  2180.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  2181.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  2182.  
  2183. To determine what note to show, scan through the table until you find
  2184. the same period as the one stored in byte 1-2. Use the index to look
  2185. up in a notenames table.
  2186.  
  2187. This is the data stored in a normal song. A packed song starts with the
  2188. four letters "PACK", but i don't know how the song is packed: You can
  2189. get the source code for the cruncher/decruncher from us if you need it,
  2190. but I don't understand it; I've just ripped it from another tracker...
  2191.  
  2192. In a module, all the samples are stored right after the patterndata.
  2193. To determine where a sample starts and stops, you use the sampleinfo
  2194. structures in the beginning of the file (from offset 20). Take a look
  2195. at the mt_init routine in the playroutine, and you'll see just how it
  2196. is done.
  2197.  
  2198. Lars "ZAP" Hamre/Amiga Freelancers
  2199.  
  2200. ***********************************************************************/
  2201.  
  2202. -- 
  2203. Mark J Cox -----
  2204. Bradford, UK ---
  2205.  
  2206.  
  2207. PS: A file with even *much* more info on MOD files, compiled by Lars
  2208. Hamre, is available from ftp.cwi.nl:/pub/audio/MOD-info.  Enjoy!
  2209.  
  2210.  
  2211. FTP sites for MODs and MOD players
  2212. ----------------------------------
  2213.  
  2214. Subject: MODS AND PLAYERS!! **READ** info/where to get them
  2215. From: cjohnson@tartarus.uwa.edu.au (Christopher Johnson)
  2216. Newsgroups: alt.binaries.sounds.d
  2217. Message-ID: <1h32ivINNglu@uniwa.uwa.edu.au>
  2218. Date: 21 Dec 92 00:19:43 GMT
  2219. Organization: The University of Western Australia
  2220.  
  2221. Hello world,
  2222.  
  2223. For all those asking, here is where to get those mod players and mods.
  2224.  
  2225. SNAKE.MCS.KENT.EDU is the best site for general stuff.  look in /pub/SB-Adlib
  2226.  
  2227. Simtel-20 or archie.au(simtel mirror) in <msdos.sound>
  2228.  
  2229. for windows players ftp.cica.indiana.edu in pub/pc/win3/sound
  2230.  
  2231. here is a short list of players
  2232.  
  2233. mp or modplay   BEST OVERALL                    mp219b.zip      
  2234.         simtel and snake
  2235.  
  2236. wowii           best for vga/fast machines      wowii12b.zip    
  2237.         simtel and snake
  2238.  
  2239. trakblaster     best for compatability          trak-something  
  2240.         simtel and snake        two versions, old one for slow
  2241.         machines
  2242.  
  2243. ss              cute display(hifi)              have_sex.arj
  2244.         found on local BBS (western Australia White Ghost)
  2245.  
  2246. superpro player generally good                  ssp.zip or similar
  2247.         found on night owl 7 CD
  2248.  
  2249. player?         cute display(hifi)              player.zip or similar
  2250.         found on night owl 7 CD
  2251.  
  2252. WINDOWS
  2253.  
  2254. Winmod pro      does protracker                 wmp????.zip
  2255.         cica
  2256.  
  2257. winmod          more stable                     winmod12.zip or similar
  2258.         cica
  2259.  
  2260. Hope this helps, e-mail me if you find any more players and I will add them in for the next time mod player requests get a
  2261. little out of hand.
  2262.  
  2263. for mods ftp to wuarchive.wustl.edu and go to the amiga music directory (pub/amiga/music/ntsb ?????)  that should do you for
  2264. a while
  2265.  
  2266. see you soon
  2267.  
  2268. Chris.
  2269.  
  2270. -----------------------------------------------------------------------
  2271.